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

feat(create-prs-to-update-vcs-repositories): new github action #317

Conversation

sasakisasaki
Copy link
Contributor

@sasakisasaki sasakisasaki commented Sep 4, 2024

Description

Add a workflow that creates PRs if the expected format tag is attached for vcs imported repositories.

Related links

Semantic Versioning Discussion

Tests performed (Referenced from the URL in "Related links")

Premise

  • Target repositories must have tags matching the pattern: semantic_version_pattern = r'\b(v?\d+\.\d+(?:\.\d+)?(?:-\w+)?(?:\+\w+(\.\d+)?)?)\b'
    • This pattern can handle following example tags
    "0.0.1",
    "v0.0.1",
    "ros2-v0.0.4",
    "xxx-1.0.0-yyy",
    "2.3.4",
    "v1.2.3-beta",
    "v1.0",
    "v2",
    "1.0.0-alpha+001",
    "v1.0.0-rc1+build.1",
    "2.0.0+build.1848",
    "2.0.1-alpha.1227",
    "1.0.0-alpha.beta",
    "ros_humble-v0.10.2"
  • If updates occur in multiple repositories, create a separate PR for each repository

Test Cases

The following tests passed:

  1. Duplicate PR Prevention

    • Executing the same Github Action multiple times should not create duplicate PRs with identical content
  2. Multiple Repository Updates

    • When updates occur simultaneously in two or more repositories, PRs should be created for each affected repository
  3. Idempotent Behavior

    • The operation should behave as expected and be idempotent, even if the target branch already exists locally or remotely
      • Examples:
        • a. No branches or PRs should be created for anything other than version updates of sub-repositories where tag updates have occurred
        • b. The Github Action should not produce errors like "branch already exists"
        • c. Github Action log output should remain consistent across runs, differing only in timestamps (excluding the initial PR creation)
  4. Post-Merge Behavior

    • After a PR is merged, no unexpected behavior should occur
      • Examples:
        • a. PRs unrelated to the update should not be created
        • b. If a branch is deleted after the merge process, the deleted branch should not be pushed again

Notes for reviewers

Perhaps some effective tests are missing in the list of tests above. I'm welcome doing the proposed tests. Your feedback is highly appreciated.

Interface changes

No change exists in this my PR

Effects on system behavior

Once this workflow is introduced into the autoware repository, new PRs related to versioning will be created automatically.

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@sasakisasaki sasakisasaki marked this pull request as draft September 4, 2024 09:53
  * noqa does not work for cspell check

Signed-off-by: Junya Sasaki <[email protected]>
@xmfcx
Copy link
Contributor

xmfcx commented Sep 4, 2024

What about renaming the workflow?

  • from: create-prs-for-vcs-repositories-update
  • to: create-prs-to-update-vcs-repositories

…t folder

  * create-prs-for-vcs-repositories-update -> create-prs-to-update-vcs-repositories

Signed-off-by: Junya Sasaki <[email protected]>
  * create-prs-for-vcs-repositories-update -> create-prs-to-update-vcs-repositories

Signed-off-by: Junya Sasaki <[email protected]>
@sasakisasaki
Copy link
Contributor Author

@xmfcx Thank you so much for your review!

What about renaming the workflow?

  • from: create-prs-for-vcs-repositories-update
  • to: create-prs-to-update-vcs-repositories

Good to me! Renamed 👍 .

@sasakisasaki
Copy link
Contributor Author

@Shin-kyoto Thank you so much for your review! Now I applied the suggestions 👍 .

@sasakisasaki sasakisasaki marked this pull request as ready for review September 5, 2024 07:08
@xmfcx xmfcx changed the title feat(create-prs-for-vcs-repositories-update): add feature for creating prs which update vcs repositories feat(create-prs-to-update-vcs-repositories): new github action Sep 5, 2024
@sasakisasaki
Copy link
Contributor Author

sasakisasaki commented Sep 6, 2024

I fixed an issue in the test-get-self-packages-and-get-modified-packages. Now all checks looks good 👀

Copy link

@Shin-kyoto Shin-kyoto left a comment

Choose a reason for hiding this comment

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

Thanks!! LGTM.

@sasakisasaki sasakisasaki merged commit cfeb08b into autowarefoundation:main Sep 10, 2024
14 checks passed
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.

3 participants