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

github: Run deps workflow against base branch and add branch name suffixes for easier debuggability #8010

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

arjan-bal
Copy link
Contributor

@arjan-bal arjan-bal commented Jan 15, 2025

Running the test against the base branch (instead of master) ensures the tests don't fail unnecessarily for PRs raised against release branches.

Env vars available in Github actions: docs

RELEASE NOTES: N/A

@arjan-bal arjan-bal requested a review from dfawley January 15, 2025 08:24
@arjan-bal arjan-bal added this to the 1.71 Release milestone Jan 15, 2025
@arjan-bal arjan-bal changed the title github: Run deps workflow against PR base branch and add branch name suffixes for easier debuggability github: Run deps workflow against base branch and add branch name suffixes for easier debuggability Jan 15, 2025
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.13%. Comparing base (130c1d7) to head (cf7cd4e).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8010      +/-   ##
==========================================
+ Coverage   81.93%   82.13%   +0.19%     
==========================================
  Files         381      384       +3     
  Lines       38581    38750     +169     
==========================================
+ Hits        31613    31826     +213     
+ Misses       5640     5606      -34     
+ Partials     1328     1318      -10     

see 30 files with indirect coverage changes

Comment on lines 39 to 40
BEFORE="$(mktemp -d --suffix="-${BEFORE_SUFFIX}")"
AFTER="$(mktemp -d --suffix="-${AFTER_SUFFIX}")"
Copy link
Member

Choose a reason for hiding this comment

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

Idea:

How about have one mktemp -d and then make two subdirectories of it which are the same as the existing BEFORE_SUFFIX and AFTER_SUFFIX and then cd to the mktemp dir before doing the diff so the relative path names are the names of the git refs? WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. Changed accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the subdir names to before and after to keep things simple. It avoids having to sanitize the branch names to ensure they are valid linux paths, handling same source and target ref names and other possible issues.

@dfawley dfawley assigned arjan-bal and unassigned dfawley Jan 15, 2025
@arjan-bal arjan-bal force-pushed the fix-deps-gh-action branch 2 times, most recently from 6a3e129 to f6a4f58 Compare January 16, 2025 10:20
@arjan-bal arjan-bal assigned dfawley and unassigned arjan-bal Jan 16, 2025
@@ -30,14 +30,20 @@ jobs:
# Run the commands to generate dependencies before and after and compare.
- name: Compare dependencies
run: |
BEFORE="$(mktemp -d)"
AFTER="$(mktemp -d)"
set -eux
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 prefer not to have this (at least the -x (tracing) part) since the output should generally be pretty human readable, and the commands should be pretty stable.

The reason I did -x in the vet script was mainly laziness around not wanting to output everything the script was doing before & after it did it. (In hindsight that was probably a bad idea, as the output confuses most people.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the -x.

# Run grep in a sub-shell since bash does not support ! in the middle of a pipe
diff -u0 -r "${BEFORE}" "${AFTER}" | bash -c '! grep -v "@@"'
diff -u0 -r "./before" "./after" | bash -c '! grep -v "@@"'
Copy link
Member

Choose a reason for hiding this comment

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

Nit: remove the ./ and I think the output will look a bit nicer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@arjan-bal arjan-bal assigned arjan-bal and unassigned dfawley Jan 16, 2025
@arjan-bal arjan-bal merged commit 89093a3 into grpc:master Jan 16, 2025
12 of 13 checks passed
@arjan-bal arjan-bal deleted the fix-deps-gh-action branch January 16, 2025 18:17
arjan-bal added a commit to arjan-bal/grpc-go that referenced this pull request Jan 22, 2025
arjan-bal added a commit that referenced this pull request Jan 22, 2025
* server: fix buffer release timing in processUnaryRPC (#7998)

* xdsclient: release lock before attempting to close underlying transport (#8011)

* github: Run deps workflow against PR target branch and improve dir names (#8010)
janardhanvissa pushed a commit to janardhanvissa/grpc-go that referenced this pull request Jan 26, 2025
purnesh42H pushed a commit to purnesh42H/grpc-go that referenced this pull request Jan 30, 2025
janardhanvissa pushed a commit to janardhanvissa/grpc-go that referenced this pull request Feb 13, 2025
janardhanvissa pushed a commit to janardhanvissa/grpc-go that referenced this pull request Feb 13, 2025
janardhanvissa pushed a commit to janardhanvissa/grpc-go that referenced this pull request Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants