Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Step Summary #1642

Merged
merged 32 commits into from
Feb 4, 2022
Merged

Add support for Step Summary #1642

merged 32 commits into from
Feb 4, 2022

Conversation

pfleidi
Copy link
Contributor

@pfleidi pfleidi commented Jan 31, 2022

This is a work in progress: I'm opening this as a draft to get some feedback while figuring out how to properly test those changes.

What does this change?

The changes in this PR will generate a unique file name per step run and make it available via the $GITHUB_STEP_SUMMARY environment variable. After a step finished executing, the contents of the file are uploaded as an attachment.

return false;
}

if (String.IsNullOrEmpty(filePath))
Copy link
Member

Choose a reason for hiding this comment

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

i would combine all file exit/empty checks into a single if and trace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TingluoHuang I found the separate trace statements useful when testing/debugging. I guess now that I have unit tests for all of them, they might not be as useful any more. Is that what you're aiming at?

Copy link
Member

Choose a reason for hiding this comment

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

we can revisit this when you inline all the methods. my main goal is to get the minimal key tracing, ex: we don't upload the summary because it's not there or empty.

@pfleidi pfleidi marked this pull request as ready for review February 3, 2022 19:37
@pfleidi pfleidi requested a review from a team as a code owner February 3, 2022 19:37
@pfleidi pfleidi merged commit 1a0d588 into main Feb 4, 2022
@pfleidi pfleidi deleted the feature/step-summary branch February 4, 2022 21:46
AdamOlech pushed a commit to antmicro/runner that referenced this pull request Aug 8, 2022
* First prototype of step summary environment variable

* Fix file contention issue

* Try to simplify cleaning up file references

* use step id as md file name, queue file attachment

* separate logic into attachment summary func

* Fix indentation

* Add (experimental) feature flag support

* reorganize summary upload determination logic

* file i/o exception handling + pr feedback

* Revert changes for now to reintroduce them later

* Add skeleton SetStepSummaryCommand

* Update step summary feature flag name

* Port ShouldUploadAttachment from previous iteration

* Port QueueStepSummaryUpload from previous iteration

* Improve exception handling when uploading attachment

* Add some minor logging improvements

* Refuse to upload files larger than 128k

* Implement secrets scrubbing

* Add TODO comment to remove debugging temp files

* Add first tests

* Add test for secret masking

* Add some naming/style fixes suggested in feedback

* inline check for feature flag

* Inline method for style consistency

* Make sure that scrubbed file doesn't exist before creating it

* Rename SetStepSummaryCommand to CreateStepSummaryCommand

* Fix error handling messages

* Fix file command name when registering extension

* Remove unnecessary file deletion

Co-authored-by: Rob Herley <robherley@github.com>
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.

5 participants