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

AAE-21850 Clean up skip PRs condition #560

Merged

Conversation

tomgny
Copy link
Contributor

@tomgny tomgny commented Apr 10, 2024

Checklist

  • Jira Reference (also in PR title):
  • README updated after adding/changing behaviour of an action
  • Proposed version increment for release:
    • Patch (bugfix)
    • Minor (new feature)
    • Major (breaking changes)
  • External PR link where changes has been tested:

Description

@tomgny tomgny requested a review from mauriziovitale April 10, 2024 07:40
@tomgny tomgny self-assigned this Apr 10, 2024
@tomgny tomgny requested a review from a team as a code owner April 10, 2024 07:40
mauriziovitale
mauriziovitale previously approved these changes Apr 10, 2024
@atchertchian
Copy link
Contributor

I'm starting to think that instead of adding so many exceptions to this list, since the "upstream" and "release" use cases are very specific to the single monorepo, maybe "whitelist-branches" should be used instead here, see doc at https://github.com/Alfresco/alfresco-build-tools?tab=readme-ov-file#enforce-pr-conventions
The only thing I'm not sure of is whether wildcards "upstream-" and "release-" would be handled correctly so that should be checked.

Overall I'd be in favor of keeping only "pr-*" in that line, that matches the generic dependabot use case (and was the original intent of this step).

WDYT please? cc @mauriziovitale @andrea-ligios

if [[ $PR_USER != 'dependabot[bot]' && $BRANCH_NAME != pr-* && $BRANCH_NAME != upstream-* ]]; then
if [[ $PR_USER != 'dependabot[bot]' && $BRANCH_NAME != pr-* && $BRANCH_NAME != upstream-* && $BRANCH_NAME != release-* ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

there is a whitelist-branches input for avoiding hardcoding branches here, which can change depending on the target repo

Copy link
Contributor

Choose a reason for hiding this comment

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

as @atchertchian mentioned above most probably we need a wildcard as suffix

        for branch in "${branches[@]}"; do
            if [[ $branch == $BRANCH_NAME ]]; then
            
  Or I am not sure if u can pass something like release-* as value

@tomgny tomgny closed this Apr 10, 2024
@tomgny tomgny reopened this Apr 10, 2024
@tomgny tomgny changed the title AAE-21850 Skip branch name check for release PR AAE-21850 Allow whitelist prefixes for branch names Apr 10, 2024
@tomgny tomgny requested review from gionn and mauriziovitale April 10, 2024 14:51
@tomgny tomgny changed the title AAE-21850 Allow whitelist prefixes for branch names AAE-21850 Clean up skip PRs condition Apr 11, 2024
@mauriziovitale mauriziovitale requested a review from gionn April 11, 2024 12:44
@tomgny tomgny merged commit 1ba3c2b into master Apr 11, 2024
3 checks passed
@tomgny tomgny deleted the improvement/AAE-21850-skip-branch-name-check-for-release-pr branch April 11, 2024 13:05
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.

4 participants