Skip to content

Conversation

@jamietanna
Copy link
Contributor

@jamietanna jamietanna commented Dec 1, 2025

Changes

As part of ongoing work to improve OpenTelemetry instrumentation of
Renovate in #38609, we can introduce an instrumented call for each
external command execution.

This makes sure we cover the two key functions used for command
execution - exec and rawExec.

Because commands could include sensitive arguments (such as repo or
global secrets) we need to make sure we sanitize the span name.

Context

Please select one of the below:

  • This closes an existing Issue: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

The public repository: https://github.com/JamieTanna-Mend-testing/backstage

When using:

module.exports = {
  secrets: {
    FAKE: "renovate/",
    FAKE_2: "yarn",
  }
}
Screenshot 2025-12-17 at 10 02 07

@jamietanna jamietanna marked this pull request as draft December 1, 2025 12:07
@jamietanna

This comment was marked as outdated.

@jamietanna jamietanna marked this pull request as ready for review December 1, 2025 15:48
@jamietanna
Copy link
Contributor Author

Thoughts on how to get that coverage up?

As part of ongoing work to improve OpenTelemetry instrumentation of
Renovate in #38609, we can introduce an instrumented call for each
external command execution.

This makes sure we cover the two key functions used for command
execution - `exec` and `rawExec`.

Because commands could include sensitive arguments (such as repo or
global secrets) we need to make sure we sanitize the span name.
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Not sure how to go about the tests :)

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can mock the instrument function to simply call the callback in tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants