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

fix: allowed regexp prefixes for exact matches #1962

Conversation

bmbferreira
Copy link
Contributor

@bmbferreira bmbferreira commented Dec 27, 2021

As you can see on the test case I added on this pull request, if the user comments for example atlantis apply -p prod/myproject it would fail if he didn't add prod on the allowed_regexp_prefixes config (added on https://github.com/runatlantis/atlantis/pull/1884/files). 😞

This PR fixes that to only check the allowed_regexp_prefixes only if there's more than one match for the regex inserted on the PR comment. If it's an exact match, it should ignore the allowed_regexp_prefixes.

@bmbferreira bmbferreira requested a review from a team as a code owner December 27, 2021 14:52
@bmbferreira bmbferreira changed the title Fix allowed regexp prefixes for exact matches fix: allowed regexp prefixes for exact matches Dec 27, 2021
Copy link

@ivanilves ivanilves left a comment

Choose a reason for hiding this comment

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

❤️

@bmbferreira bmbferreira reopened this Dec 30, 2021
@jamengual
Copy link
Contributor

@chenrui333 can you review this fix?

Copy link
Member

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

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

lgtm

@chenrui333 chenrui333 merged commit cc513d4 into runatlantis:master Jan 5, 2022
@bmbferreira bmbferreira deleted the fix-allowed-regexp-prefixes-for-exact-matches branch January 5, 2022 18:17
krrrr38 pushed a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
* test: adds failing test case

* fix: return project if there's an exact match, even if the prefix is not on the allowed list
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.

None yet

4 participants