-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
chore: Generate between split repos and main #8442
Conversation
How about limiting first 1000 diff files in the pull request? (We can't see thousands of files anyway) Once the script is ready and merged to main, we want a GitHub Actions job that updates a branch periodically. We monitor a pull request from the branch to observe the changes. |
I didn't want to manually limit/exclude certain files. I've taken a look at a few of the diffs locally and I think quite a few of them can be ignored. Ignoring these files should help us limit the number of diffs we need to check:
Need to check:
The pom.xml files shouldn't have custom pom.xml, but I can do a separate and specific diff (either in a new PR or a seperate branch) to check each pom.xml. What do you think about the proposed ignored files above? @suztomo
I can look into a GH action once I flush out the script with the diffs that I want to show. |
Plan forward is two branches
Script will create two branches and create PRs for each branch that show the diffs |
We need 1 script generation/generate_diff.sh. The two jobs that run upon updating main branch: 1st GitHub Actions job
2nd GitHub Actions job
|
git stash | ||
git checkout "${current_branch}" | ||
git stash pop | ||
|
||
git checkout -b "${diff_non_java_branch}" | ||
git add . |
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.
I like the use of git stash
to separete Java change and non-Java changes.
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.
Let me know if you have a better option. I couldn't think besides this that wouldn't require either two jobs or running the script twice.
- name: Run generate-diff script | ||
run: ./generation/generate_diff.sh | ||
env: | ||
USERNAME: ${{ github.actor }} |
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.
Did it work? If not YOSHI_CODE_BOT_TOKEN
is available.
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.
push: | ||
branches: | ||
- main | ||
pull_request: |
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.
I assume you're testing. We don't need this job at pull request checks.
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.
Yep! Just added in fa84ab5 so the CI only runs on non-PR push
events (should be merge only)
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.
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.
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.
Would you explain why you need this line 19 " pull_request:" ?
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.
I can skip it from running all together.
Yes, please do so. Remove line 19.
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.
Ah good catch! I've removed the check.
the job is appearing pull request checks
I'll merge this now to have it regenerate the diffs on merge. I'll create a separate PR to split the ITs and other Java code. |
* chore: Generate diff from current split repos * chore: Call delete samples script afterwards * chore: Display diff on GH * chore: Push diffs to seperate branches * Revert "chore: Display diff on GH" This reverts commit 8a616dc. * chore: Create seperate branches * chore: Add push to multiple branches * chore: Stash the non staged changes * chore: Delete non-generated samples * chore: Add retry for git clone * chore: Remove untracked filed * chore: Run from main-diff branch * chore: Fix Typo * chore: cleanup branches * chore: Test if it can ci works * chore: Delete branch only if doesn't exist * chore: Set git username/email * chore: Use fetch-depth 0 to allow unshallow update * chore: Only run on merge * chore: Run action only on merge * chore: Remove run on pull_request
Following Tomo's script advice:
For now:
pom.xml
sgit diff --name-only origin/main | grep -v "pom.xml" | grep -v "CHANGELOG.md" | grep -v "README.md" | grep -v "renovate.json" | grep -v "versions.txt" | grep -v "samples/*" > diff.txt
Probably should ignore owlbot files and .github/*
Shows only the name of the files that have changed: diff.txt
Github has issue displaying the diffs. Might need to only add the files listed in the diff.txt