Skip to content

Commit dc1ec26

Browse files
Merge remote-tracking branch 'origin/main' into release
2 parents bd11688 + 89cb9da commit dc1ec26

File tree

15 files changed

+155
-5
lines changed

15 files changed

+155
-5
lines changed

.github/workflows/pr-metadata-docs-and-deps.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,30 @@ jobs:
180180
body-path: doc-check-results.md
181181
edit-mode: replace
182182

183+
missing-docs-delete:
184+
needs: changed-crates
185+
if: needs.changed-crates.outputs.crates_count == 0
186+
runs-on: ubuntu-latest
187+
permissions:
188+
pull-requests: write
189+
steps:
190+
- name: Find existing comment
191+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
192+
id: find-comment
193+
with:
194+
issue-number: ${{ github.event.pull_request.number }}
195+
comment-author: 'github-actions[bot]'
196+
body-includes: '## 📚 Documentation Check Results'
197+
- name: Delete existing docs comment
198+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
199+
with:
200+
script: |
201+
github.rest.issues.deleteComment({
202+
owner: context.repo.owner,
203+
repo: context.repo.repo,
204+
comment_id: ${{ steps.find-comment.outputs.comment-id }},
205+
})
206+
183207
changelog-check:
184208
needs: changed-crates
185209
if: |
@@ -338,3 +362,27 @@ jobs:
338362
run: |
339363
echo "cargo-deny found ${{ steps.cargo-deny.outputs.total_errors }} error(s) and FAIL_IF_CARGO_DENY is enabled"
340364
exit 1
365+
366+
dependency-check-delete:
367+
needs: changed-crates
368+
if: needs.changed-crates.outputs.crates_count == 0
369+
runs-on: ubuntu-latest
370+
permissions:
371+
pull-requests: write
372+
steps:
373+
- name: Find existing comment
374+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
375+
id: find-comment
376+
with:
377+
issue-number: ${{ github.event.pull_request.number }}
378+
comment-author: 'github-actions[bot]'
379+
body-includes: '## 🔒 Cargo Deny Results'
380+
- name: Delete existing dependency check comment
381+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
382+
with:
383+
script: |
384+
github.rest.issues.deleteComment({
385+
owner: context.repo.owner,
386+
repo: context.repo.repo,
387+
comment_id: ${{ steps.find-comment.outputs.comment-id }},
388+
})

.github/workflows/release-proposal-dispatch.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ jobs:
136136
steps:
137137
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
138138
with:
139-
fetch-depth: 0 # Need full history for git tags
139+
ref: ${{ env.RELEASE_BRANCH }}
140+
fetch-depth: 0
141+
fetch-tags: true
140142
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
141143
with:
142144
cache-targets: true
@@ -186,6 +188,14 @@ jobs:
186188
- name: Create a branch for the release proposal
187189
id: proposal-branch
188190
run: |
191+
git status
192+
193+
IS_SHALLOW=$(git rev-parse --is-shallow-repository)
194+
if [ "$IS_SHALLOW" = "true" ]; then
195+
echo "Repository is shallow"
196+
git pull --unshallow
197+
fi
198+
189199
git checkout "${{ env.RELEASE_BRANCH }}"
190200
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
191201
BRANCH_NAME="${{ env.PROPOSAL_BRANCH_PREFIX }}/${{ inputs.crate }}/$TIMESTAMP"
@@ -380,7 +390,6 @@ jobs:
380390
"",
381391
(if $api_info.version then "**Next version:** `\($api_info.version)`\n" else null end),
382392
"**Semver bump:** `\($api_info.level)`",
383-
"",
384393
(if $api_info.tag then "**Tag:** `\($api_info.tag)`\n" else null end),
385394
(if $api_info.initial_release == "true" then
386395
"**Warning:** this is an initial release. Please verify that the version and commits included are correct.\n"

cliff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ commit_parsers = [
8585
{ message = "^feat", group = "<!-- A -->Added" },
8686
{ message = "^fix", group = "<!-- C -->Fixed" },
8787
{ message = "^refactor\\(clippy\\)", skip = true },
88-
{ message = "^chore\\(release\\): prepare for", skip = true },
88+
{ message = "^chore\\(release\\)", skip = true },
8989
{ message = "^chore: Release", skip = true },
9090
{ message = "^chore\\(deps.*\\)", skip = true },
9191
{ message = "^chore\\(pr\\)", skip = true },

datadog-sidecar-ffi/src/lib.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ pub unsafe extern "C" fn ddog_sidecar_session_set_config(
588588
remote_config_capabilities_count: usize,
589589
remote_config_enabled: bool,
590590
is_fork: bool,
591+
process_tags: ffi::CharSlice,
591592
) -> MaybeError {
592593
#[cfg(unix)]
593594
let remote_config_notify_target = libc::getpid();
@@ -631,13 +632,31 @@ pub unsafe extern "C" fn ddog_sidecar_session_set_config(
631632
.as_slice()
632633
.to_vec(),
633634
remote_config_enabled,
635+
process_tags: process_tags.to_utf8_lossy().into(),
634636
},
635637
is_fork
636638
));
637639

638640
MaybeError::None
639641
}
640642

643+
/// Updates the process_tags for an existing session.
644+
#[no_mangle]
645+
#[allow(clippy::missing_safety_doc)]
646+
pub unsafe extern "C" fn ddog_sidecar_session_set_process_tags(
647+
transport: &mut Box<SidecarTransport>,
648+
session_id: ffi::CharSlice,
649+
process_tags: ffi::CharSlice,
650+
) -> MaybeError {
651+
try_c!(blocking::set_session_process_tags(
652+
transport,
653+
session_id.to_utf8_lossy().into(),
654+
process_tags.to_utf8_lossy().into(),
655+
));
656+
657+
MaybeError::None
658+
}
659+
641660
#[repr(C)]
642661
pub struct TracerHeaderTags<'a> {
643662
pub lang: ffi::CharSlice<'a>,

datadog-sidecar-ffi/tests/sidecar.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ fn test_ddog_sidecar_register_app() {
112112
0,
113113
false,
114114
false,
115+
"".into(),
115116
)
116117
.unwrap_none();
117118

@@ -162,6 +163,7 @@ fn test_ddog_sidecar_register_app() {
162163
0,
163164
false,
164165
false,
166+
"".into(),
165167
)
166168
.unwrap_none();
167169

datadog-sidecar/src/service/blocking.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,28 @@ pub fn set_session_config(
243243
})
244244
}
245245

246+
/// Updates the process tags for an existing session.
247+
///
248+
/// # Arguments
249+
///
250+
/// * `transport` - The transport used for communication.
251+
/// * `session_id` - The ID of the session.
252+
/// * `process_tags` - The process tags string to set.
253+
///
254+
/// # Returns
255+
///
256+
/// An `io::Result<()>` indicating the result of the operation.
257+
pub fn set_session_process_tags(
258+
transport: &mut SidecarTransport,
259+
session_id: String,
260+
process_tags: String,
261+
) -> io::Result<()> {
262+
transport.send(SidecarInterfaceRequest::SetSessionProcessTags {
263+
session_id,
264+
process_tags,
265+
})
266+
}
267+
246268
/// Sends a trace as bytes.
247269
///
248270
/// # Arguments

datadog-sidecar/src/service/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub struct SessionConfig {
6464
pub remote_config_products: Vec<RemoteConfigProduct>,
6565
pub remote_config_capabilities: Vec<RemoteConfigCapabilities>,
6666
pub remote_config_enabled: bool,
67+
pub process_tags: String,
6768
}
6869

6970
#[derive(Debug, Deserialize, Serialize)]

datadog-sidecar/src/service/session_info.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub(crate) struct SessionInfo {
4343
pub(crate) session_id: String,
4444
pub(crate) pid: Arc<AtomicI32>,
4545
pub(crate) remote_config_enabled: Arc<Mutex<bool>>,
46+
pub(crate) process_tags: Arc<Mutex<Option<String>>>,
4647
}
4748

4849
impl Clone for SessionInfo {
@@ -62,6 +63,7 @@ impl Clone for SessionInfo {
6263
session_id: self.session_id.clone(),
6364
pid: self.pid.clone(),
6465
remote_config_enabled: self.remote_config_enabled.clone(),
66+
process_tags: self.process_tags.clone(),
6567
}
6668
}
6769
}

datadog-sidecar/src/service/sidecar_interface.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ pub trait SidecarInterface {
6767
is_fork: bool,
6868
);
6969

70+
/// Updates the process tags for an existing session.
71+
///
72+
/// # Arguments
73+
///
74+
/// * `session_id` - The ID of the session.
75+
/// * `process_tags` - The process tags string.
76+
async fn set_session_process_tags(session_id: String, process_tags: String);
77+
7078
/// Shuts down a runtime.
7179
///
7280
/// # Arguments

datadog-sidecar/src/service/sidecar_server.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ impl SidecarInterface for SidecarServer {
421421
.unwrap_or("unknown-service");
422422
let env = entry.get().env.as_deref().unwrap_or("none");
423423

424+
let process_tags = session.process_tags.lock_or_panic().clone();
425+
424426
// Lock telemetry client
425427
let telemetry_mutex = self.telemetry_clients.get_or_create(
426428
service,
@@ -438,6 +440,7 @@ impl SidecarInterface for SidecarServer {
438440
Config::default()
439441
})
440442
},
443+
process_tags,
441444
);
442445
let mut telemetry = telemetry_mutex.lock_or_panic();
443446

@@ -565,6 +568,8 @@ impl SidecarInterface for SidecarServer {
565568
*session.remote_config_notify_function.lock().unwrap() = remote_config_notify_function;
566569
}
567570
*session.remote_config_enabled.lock_or_panic() = config.remote_config_enabled;
571+
*session.process_tags.lock_or_panic() =
572+
(!config.process_tags.is_empty()).then_some(config.process_tags.clone());
568573
session.modify_telemetry_config(|cfg| {
569574
cfg.telemetry_heartbeat_interval = config.telemetry_heartbeat_interval;
570575
let endpoint = get_product_endpoint(
@@ -658,6 +663,19 @@ impl SidecarInterface for SidecarServer {
658663
})
659664
}
660665

666+
type SetSessionProcessTagsFut = NoResponse;
667+
668+
fn set_session_process_tags(
669+
self,
670+
_: Context,
671+
session_id: String,
672+
process_tags: String,
673+
) -> Self::SetSessionProcessTagsFut {
674+
let session = self.get_session(&session_id);
675+
*session.process_tags.lock_or_panic() = (!process_tags.is_empty()).then_some(process_tags);
676+
no_response()
677+
}
678+
661679
type ShutdownRuntimeFut = NoResponse;
662680

663681
fn shutdown_runtime(self, _: Context, instance_id: InstanceId) -> Self::ShutdownRuntimeFut {

0 commit comments

Comments
 (0)