You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
As you can see, I'm not able to apply it because the merge doesn't take the branch in account
Logs
{"level":"info","ts":"2025-01-28T12:47:44.125Z","caller":"models/shell_command_runner.go:181","msg":"successfully ran 'sh -c' '/atlantis-data/bin/terraform1.9.2 init -input=false -upgrade -reconfigure' in '/atlantis-data/repos/ultraio/devops/terraform/0/default/gitlab/ultra-organization'","json":{"duration":11.795900726}}
{"level":"info","ts":"2025-01-28T12:47:44.516Z","caller":"terraform/terraform_client.go:383","msg":"Successfully ran '/atlantis-data/bin/terraform1.9.2 workspace show' in '/atlantis-data/repos/ultraio/devops/terraform/0/default/gitlab/ultra-organization'","json":{"duration":0.390805303}}
{"level":"info","ts":"2025-01-28T12:48:06.466Z","caller":"models/shell_command_runner.go:181","msg":"successfully ran 'sh -c' '/atlantis-data/bin/terraform1.9.2 plan -input=false -refresh -out \"/atlantis-data/repos/ultraio/devops/terraform/0/default/gitlab/ultra-organization/ultra-organization-default.tfplan\" -var vault_dev_token=${DEV_VAULT_TOKEN} -var vault_staging_token=${STAGING_VAULT_TOKEN} -var vault_prod_token=${PROD_VAULT_TOKEN}' in '/atlantis-data/repos/ultraio/devops/terraform/0/default/gitlab/ultra-organization'","json":{"duration":21.948748395}}
{"level":"error","ts":"2025-01-28T12:48:08.586Z","caller":"events/instrumented_project_command_runner.go:84","msg":"Failure running apply operation: Pull request must be approved according to the project's approval rules before running apply.","json":{},"stacktrace":"github.com/runatlantis/atlantis/server/events.RunAndEmitStats\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:84\ngithub.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandRunner).Apply\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:46\ngithub.com/runatlantis/atlantis/server/controllers.(*APIController).apiApply\n\tgithub.com/runatlantis/atlantis/server/controllers/api_controller.go:185\ngithub.com/runatlantis/atlantis/server/controllers.(*APIController).Apply\n\tgithub.com/runatlantis/atlantis/server/controllers/api_controller.go:130\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/[email protected]/mux.go:212\ngithub.com/urfave/negroni/v3.(*Negroni).UseHandler.Wrap.func1\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:59\ngithub.com/urfave/negroni/v3.HandlerFunc.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:33\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP\n\tgithub.com/runatlantis/atlantis/server/middleware.go:70\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Recovery).ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/recovery.go:210\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Negroni).ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:111\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:3210\nnet/http.(*conn).serve\n\tnet/http/server.go:2092"}
{"level":"warn","ts":"2025-01-28T12:48:08.587Z","caller":"controllers/api_controller.go:253","msg":"{\"Error\":null,\"Failure\":\"\",\"ProjectResults\":[{\"Command\":0,\"SubCommand\":\"\",\"RepoRelDir\":\"gitlab/ultra-organization\",\"Workspace\":\"default\",\"Error\":null,\"Failure\":\"Pull request must be approved according to the project's approval rules before running apply.\",\"PlanSuccess\":null,\"PolicyCheckResults\":null,\"ApplySuccess\":\"\",\"VersionSuccess\":\"\",\"ImportSuccess\":null,\"StateRmSuccess\":null,\"ProjectName\":\"ultra-organization\",\"SilencePRComments\":null}],\"PlansDeleted\":false}","json":{},"stacktrace":"github.com/runatlantis/atlantis/server/controllers.(*APIController).respond\n\tgithub.com/runatlantis/atlantis/server/controllers/api_controller.go:253\ngithub.com/runatlantis/atlantis/server/controllers.(*APIController).Apply\n\tgithub.com/runatlantis/atlantis/server/controllers/api_controller.go:144\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/[email protected]/mux.go:212\ngithub.com/urfave/negroni/v3.(*Negroni).UseHandler.Wrap.func1\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:59\ngithub.com/urfave/negroni/v3.HandlerFunc.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:33\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP\n\tgithub.com/runatlantis/atlantis/server/middleware.go:70\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Recovery).ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/recovery.go:210\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Negroni).ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:111\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:3210\nnet/http.(*conn).serve\n\tnet/http/server.go:2092"}
Additional Context
The text was updated successfully, but these errors were encountered:
@flassagn Hello! I'm here to help you with any issues or questions you have. Let's work together to find a solution.
I found a similar open issue regarding branch regex not working as expected in Atlantis. The suggested solution in that thread is to ensure that the branch is specified correctly in the configuration, like so:
branch: /^pull_request_destination_branch_name$/
You might want to check if your branch regex is correctly defined and matches the branch name exactly as expected [1].
For the record, I already identify where the codebase need to be updated to the getMatchingCfg private function in order to also support filtering by branch.
Same feature need to be added at MatchingRepo accordingly.
I could do a PR but I would to confirm with you the defect and see if you want to support this behavior.
Community Note
Overview of the Issue
I would like to have distinct repo match on
branch
match and not onlyrepoID
which it seems allowed by the documentation https://www.runatlantis.io/docs/server-side-repo-config.html#reference.Reproduction Steps
Configure the server side configuration with the following content
And request an apply from
main
branch, I used the api enpoint myselfAs you can see, I'm not able to apply it because the merge doesn't take the branch in account
Logs
Additional Context
The text was updated successfully, but these errors were encountered: