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

Allow reapply default branch without PR #3626

Open
MichaelKora opened this issue Jul 26, 2023 · 6 comments
Open

Allow reapply default branch without PR #3626

MichaelKora opened this issue Jul 26, 2023 · 6 comments
Labels
bug Something isn't working Stale

Comments

@MichaelKora
Copy link

Community Note

  • 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.

Overview of the Issue

I manage my infrastructure with Atlantis, and it works well. The only drawback is that if the infrastructure changes and I want to re-apply the default branch, I'll need create a dummy PR.

It would be useful to be able to re-apply the configuration on the default branch without PR, as it has already been merged using the Atlantis workflow.

Atlantis, according to the documentation, does not support this. Is there an effective method to archive that?


Environment details

Atlantis on Cloud Run
GitHub as VCS
Atlantis image: runatlantis/atlantis:v0.23.3

@MichaelKora MichaelKora added the bug Something isn't working label Jul 26, 2023
@brandon-fryslie
Copy link

This would be great and ver useful, but seems technically difficult since it seems like anyone could apply the Terraform at any time on any closed PR.

@jamengual
Copy link
Contributor

yes, this could be pretty dangerous, so I'm wondering what is the usecase here? drift detection?

@MichaelKora
Copy link
Author

MichaelKora commented Jul 28, 2023

@jamengual yes the ideal would be to have drift detection. But actually am really just trying to re-apply the main. The Atlantis API seems to be a secured and reasonable approach(since it authenticates requests using the api-secret), the only issue am having with that is {"error":"failed to build command: checking if workspace exists: stat /home/atlantis/.atlantis/repos/..../0/default: no such file or directory"}

Seems like it's not able to create a workspace for the main branch ("PR":0).

As soon as i passed a valid PR, it works fine but that's not the goal and it also does not make any sense in my case to use the API for the PRs.

Here's my request:

curl --request POST ''"$the_url"'/api/plan' \
--header 'X-Atlantis-Token: '"$the_sec"'' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Repository": "'"$the_repo"'",
    "Ref": "main",
    "Type": "Github",
    "Paths": [{ 
        "Directory": ".",
        "Workspace": "default" 
    }],
    "PR": 0
}'

@MichaelKora
Copy link
Author

@jamengual seems like you had a similar issue(#2949) and it seems like the proposed solution (#3584) has not been merged yet

@jamengual
Copy link
Contributor

we need to review that PR, we will get to it.

@MichaelKora
Copy link
Author

i think that will fix my issue.

@dosubot dosubot bot added the Stale label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

3 participants