GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Respect `end-tracing` script instead of deleting one variable by edoardopirovano · Pull Request #938 · github/codeql-action

Conversation

@edoardopirovano

@edoardopirovano edoardopirovano commented Feb 17, 2022

Copy link
Copy Markdown
Contributor

This might fix an issue we've observed with the CLR tracing continuing to trace after we've supposedly stopped tracing. It also just seems the more correct thing to do anyway. The variable that was previously deleted (ODASA_TRACER_CONFIGURATION) is always unset by end-tracing, so we should only be doing more to try and halt tracing.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@edoardopirovano
edoardopirovano requested a review from a team as a code owner February 17, 2022 15:47
@edoardopirovano
edoardopirovano requested a review from criemen February 17, 2022 15:48
@edoardopirovano
edoardopirovano force-pushed the respect-end-tracing branch 2 times, most recently from 3f68d85 to 84ab7c2 Compare February 17, 2022 15:57
criemen
criemen approved these changes Feb 17, 2022
View reviewed changes

@criemen criemen left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM from my side, but a JS person should review as well.
I checked that for C#, end-tracing.json indeed contains (besides others)

"COR_ENABLE_PROFILING":null,"COR_PROFILER":null,"COR_PROFILER_PATH_64":null,"CORECLR_ENABLE_PROFILING":null,"CORECLR_PROFILER":null

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@edoardopirovano
edoardopirovano force-pushed the respect-end-tracing branch from 84ab7c2 to 6a910c7 Compare February 17, 2022 16:14
aeisenberg
aeisenberg reviewed Feb 23, 2022
View reviewed changes
Comment thread src/tracer-config.ts Outdated
Comment on lines +29 to +53
const endTracingEnvVariables: Map<string, string | null> = JSON.parse(
fs.readFileSync(
path.resolve(
config.dbLocation,
"temp/tracingEnvironment/end-tracing.json"
),
"utf8"
)
);
for (const [key, value] of Object.entries(endTracingEnvVariables)) {
if (value !== null) {
process.env[key] = value;
} else {
delete process.env[key];
}
}

@aeisenberg aeisenberg Feb 23, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can you wrap this in a try-catch and rethrow with a good error message if the file doesn't exist or is malformed?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

edoardopirovano reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
aeisenberg
aeisenberg reviewed Feb 23, 2022
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Small suggestion, but I think it is important to help avoid potential problems with users' workflows.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
edoardopirovano added 2 commits February 23, 2022 16:21
@edoardopirovano
Respect end-tracing script instead of deleting one variable
c592525
@edoardopirovano
Improve error handling for ending tracing
afbddca
@edoardopirovano
edoardopirovano force-pushed the respect-end-tracing branch from 6a910c7 to afbddca Compare February 23, 2022 16:44
@edoardopirovano

edoardopirovano commented Feb 23, 2022

Copy link
Copy Markdown
Contributor Author

Thanks @aeisenberg, I've added some more error handling!

I note that it would be nice to have this for the start of tracing as well. The natural thing to do would be to have a utility function that can parse either file and contains all the error handling. Unfortunately, it's not quite that easy because the types of the return value are different as the end tracing file can contain null values to unset environment variables whereas the start tracing one cannot, so we'd have to change the types of quite a few things all around the code that use the start tracing file.

I propose leaving that extension for a future PR since that seems to be growing the scope of this PR too much.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aeisenberg
aeisenberg approved these changes Feb 23, 2022
View reviewed changes
@edoardopirovano
edoardopirovano enabled auto-merge February 23, 2022 16:54
@edoardopirovano
edoardopirovano merged commit d7ad71d into main Feb 23, 2022
@edoardopirovano
edoardopirovano deleted the respect-end-tracing branch February 23, 2022 17:08
@github-actions github-actions Bot mentioned this pull request Feb 23, 2022
Merge main into v1 #946
Merged
4 of 5 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Mar 6, 2025
[pull] main from github:main StemmlerSisters/codeql-action#1
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@criemen criemen criemen approved these changes
@aeisenberg aeisenberg aeisenberg approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@edoardopirovano @criemen @aeisenberg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.