-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat(sync-files): allow multiple destinations and speed up clone #295
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
To make better sense of things, I will share outputs of some commands so they are more concrete for everyone: Files🖱️Click here to expand🔛The input filemfc@mfc-leo:~$ cat /tmp/sync-files.yaml
- files:
- delete-orphaned: true
dest: .github/workflows/build-and-test-daily.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/build-and-test.yaml
- delete-orphaned: true
dest: .github/workflows/build-and-test-daily-arm64.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/build-and-test.yaml
- delete-orphaned: true
dest: .github/workflows/check-build-depends.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/check-build-depends.yaml
- delete-orphaned: true
dest: .github/workflows/clang-tidy-pr-comments.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/clang-tidy-pr-comments.yaml
- delete-orphaned: true
dest: .github/workflows/clang-tidy-pr-comments-manually.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/clang-tidy-pr-comments-manually.yaml
- delete-orphaned: true
dest: .github/workflows/update-codeowners-from-packages.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/update-codeowners-from-packages.yaml
- delete-orphaned: true
dest: .pre-commit-config.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .pre-commit-config.yaml
- delete-orphaned: true
dest: codecov.yaml
post-commands: ''
pre-commands: ''
replace: true
source: codecov.yaml
ref: ''
repository: https://github.com/autowarefoundation/autoware_common.git Iterated last repositorymfc@mfc-leo:~$ cat /tmp/repo-config.yaml
files:
- delete-orphaned: true
dest: .github/workflows/build-and-test-daily.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/build-and-test.yaml
- delete-orphaned: true
dest: .github/workflows/build-and-test-daily-arm64.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/build-and-test.yaml
- delete-orphaned: true
dest: .github/workflows/check-build-depends.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/check-build-depends.yaml
- delete-orphaned: true
dest: .github/workflows/clang-tidy-pr-comments.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/clang-tidy-pr-comments.yaml
- delete-orphaned: true
dest: .github/workflows/clang-tidy-pr-comments-manually.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/clang-tidy-pr-comments-manually.yaml
- delete-orphaned: true
dest: .github/workflows/update-codeowners-from-packages.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .github/workflows/update-codeowners-from-packages.yaml
- delete-orphaned: true
dest: .pre-commit-config.yaml
post-commands: ''
pre-commands: ''
replace: true
source: .pre-commit-config.yaml
- delete-orphaned: true
dest: codecov.yaml
post-commands: ''
pre-commands: ''
replace: true
source: codecov.yaml
ref: ''
repository: https://github.com/autowarefoundation/autoware_common.git Iterated last file item; (
|
Signed-off-by: M. Fatih Cırıt <[email protected]>
mitsudome-r
approved these changes
Jun 7, 2024
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
https://github.com/autowarefoundation/autoware.universe/pull/7368/files @mitsudome-r works now, thanks for reviewing! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Speed up how?
Added
--depth 1
to thegit clone
operation, performing a shallow clone, avoiding downloading entire history and branches of a repository.It doesn't use anything more, so it should be safe.
Why iterate over multiple destinations? What was wrong with the existing approach?
Assume the following
sync-files.yaml
configuration:It wants to copy from a source file into multiple destinations.
But when we run it with the existing configuration, it only generates the
dest: .github/workflows/build-and-test-daily-arm64.yaml
file. And completely ignores the first destination.Proof
🖱️Click here to expand🔛
Input:
It only creates arm64 version:
Why does this occur?
To tackle this, I've ran https://gist.github.com/xmfcx/054a81b38ea583d39f792c6679c7bcde?permalink_comment_id=5081803#gistcomment-5081803 this script that I copied from the action itself. Put this in my autoware.universe directory.
Then put this https://gist.github.com/xmfcx/054a81b38ea583d39f792c6679c7bcde?permalink_comment_id=5081799#gistcomment-5081799 file in
/tmp/sync-files.yaml
Also installed:
When I ran it, I saw:
Duplicate entries.
But then I ran it with the updated version from https://gist.github.com/xmfcx/054a81b38ea583d39f792c6679c7bcde?permalink_comment_id=5081803#file-sync-files-bash
And it was fixed:
We have both files generated.
Effects on system behavior
I can't see this breaking any existing behavior.
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.