Fix Copilot runtime instrumentation during action extraction#3513
Conversation
|
Hello, thanks for contributing for the first time! |
plengauer
left a comment
There was a problem hiding this comment.
@copilot no, thats not it. first of all, drop the simulated test. second, if by cache u mean the caching behavior of this very project, then i dont see the reason it inteferes. if im missing it, expand you explanation (make it really for dummies) or start from scratch searching for the root cause. my thinking is it cant be it, because thats literally how all other special instrumentations work. i dont see why this one would be special / broken
Addressed in Why this one is different: on cache hits, |
plengauer
left a comment
There was a problem hiding this comment.
@copilot thanks for the explanation, i see what you mean now. but for this to be the root cause, there would have to be a cache in the first place. which would mean exact same executables, same path, .... and all the same for a cache to be actually active as per the cache definition. is that likely. look at the logs again.
I re-checked the logs (including The cache conditions are likely met within the same job: the same instrumented shell path is reused many times ( You’re right that the logs don’t print an explicit |
plengauer
left a comment
There was a problem hiding this comment.
@copilot i think you are on the wrong track. the path that is used for the cache key calculation is the path to the script, not to the shell executable. which means it will be different. compare the log and the code that is run (Its in the log) to the if checks here and figure out if it actually triggers
You’re right — on this run the cache-key path/hit is not the thing to rely on. I checked run The more direct drop-point is in the step wrapper: |
plengauer
left a comment
There was a problem hiding this comment.
@copilot again, you are wrong. the decorate action does not instrument directly, it just calls a bash script where normal instrumentation is triggered. the fact that the decorate_action files only load a subset of insturmentation has nothing to do with it
You’re right. I rechecked the run path and fixed the actual drop point in The tar hook was only scanning |
There was a problem hiding this comment.
Pull request overview
Fixes Copilot runtime instrumentation by expanding the tar-extraction patching loop to scan both the current working directory and ${RUNNER_TEMP} for extracted action scripts, since Copilot scripts initially appear in ./ before being moved.
Changes:
- Glob now covers
./*-action-*/*/*.shin addition to${RUNNER_TEMP}/*-action-*/*/*.sh. - Added
[ -f "$script_file" ] || continueguard so unmatched globs don't fail.
Copilot cloud-agent instrumentation could be skipped because the Copilot tar hook only patched scripts under
${RUNNER_TEMP}, while extracted*-action-*scripts are first present in the current working directory and only moved to${RUNNER_TEMP}afterward.Copilot script patching fixed for actual extraction flow
agent.instrumentation.github.copilot.shto patch both:./*-action-*/*/*.sh${RUNNER_TEMP}/*-action-*/*/*.shAlias registration behavior restored
This keeps the fix focused on the real runtime path where Copilot setup scripts are extracted and executed.