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

Branch name validation script #2017

Merged
merged 4 commits into from
Feb 28, 2025
Merged

Conversation

erenbesel
Copy link
Contributor

Problem

We realized we currently only have branch rules for develop, meaning any PR targeted to any other branch than develop can be freely merged without our branch rules (e.g., 3 approvals, resolved conversations, green CI etc).

Solution

Github allows creating rules for specific branches but that would mean we would need a new rule for every new branch which is not sustainable. Fortunately Github also allows rules for branch folders such as feature/* so we can create branch rules under such folders.

This would require all future branches to be created with these prefixes. This PR achieves it with a script and add it in our pre-commit hook.

Currently naming format is {labelName}/{branchName}

labelName = feature, fix, chore, improvement, release

branchName = Any name ( can be made to always include COIOS string)

Ticket

COIOS-870

@erenbesel erenbesel added the chore a pull request that has chore changes that shouldn't be in the release notes label Feb 18, 2025
github-actions[bot]
github-actions bot previously approved these changes Feb 18, 2025
@atmamont
Copy link
Contributor

Should we enable base PR checks for new branches subset?

@erenbesel erenbesel marked this pull request as ready for review February 27, 2025 10:53
atmamont
atmamont previously approved these changes Feb 27, 2025
goergisn
goergisn previously approved these changes Feb 27, 2025
Copy link
Contributor

✅ No changes detected

Comparing improvement/branch_name_validation to develop


Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCashAppPay, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenWeChatPay

@goergisn
Copy link
Contributor

Looks great!

Some potential improvement for the future would be validating the version number if it's a release branch

@erenbesel erenbesel merged commit 9a4a180 into develop Feb 28, 2025
14 checks passed
@erenbesel erenbesel deleted the improvement/branch_name_validation branch February 28, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore a pull request that has chore changes that shouldn't be in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants