Oh, I believe I see what you're referring to. In the previous approach we had without Atmos Pro and only using GitHub Actions, we ran drift detection when a PR was merged. When there were detected changes, we would open an issue
However, now with Atmos Pro, it's much simpler, and we aren't using GitHub issues anymore. The specified workflow is simply run when the PR is merged. In our case, that is apply Terraform.
1.
In Atmos stack config, you map specific GitHub events to GitHub workflows
2.
In GitHub, you set up GitHub Actions workflows to run on some of those events (PR opened, merged, etc)
3.
In GitHub, GitHub Actions uploads the affected stacks DTO from GitHub Actions to Atmos Pro
4. Atmos Pro receives that list of affected stacks for a specific event, including the stack config mapping of GitHub event to workflow
5. Atmos Pro then dispatches that specific GitHub workflow for each affected stack
So in the scenario above:
1. When PR1 is merged, the changes from PR1 are compared against the main branch at that time. GitHub Actions uploads that list of affected stacks to Atmos Pro
2. Atmos Pro ingests that list of stacks and dispatches the specified workflow for every single one, typically Terraform apply.
3. Then, when PR2 is merged, it does the exact same thing. the SHAs are compared when that PR is merged and affected stacks are uploaded to Atmos Pro
4. Atmos Pro then dispatches those workflows
This means you may have workflows queued for s3-test-ue1-dev. The first from PR1, and the second from PR2. You can set up workflow concurrency if you'd like to cancel one and apply the second. But that's entirely configurable in the workflow itself
However, regarding number three, drift detection has no knowledge of these PRs or current status. It just dispatches the detect workflows when it is triggered from the main branch. If there are unapplied changes, then they show up on the dashboard as unapplied, where you can then trigger remediation as you'd like