Expose Run Promotion Flag in Payload

It would be great if you were able to include a Boolean flag for promoted runs in the run portion of the data input payload. This would be useful for crafting plan and approval policies.

We allow run promotion to be enabled in environments beyond DEV, but we require special approval for QA and STAGE if it’s not being deployed through the normal PR process. We can typically determine if it was a run promotion by trying to compare the stack’s branch with the run’s branch, but that’s not always possible since setting commit sha with spacectl or other methods sometimes puts “-” as the branch.

It would be much simpler to just check if promoted_run: true and that the stack has a qa or stage label to require an approval.

Run Promotion - Spacelift Documentation
Approval policy - Spacelift Documentation
Plan policy - Spacelift Documentation

Workaround
Compare stack and run branches to determine if run promotion was likely used. Comparing branches isn't always ideal because API triggered stack deploys via spacectl with commit sha usually have "-" as the branch which would be considered a branch mismatch for checking if branches are different. For that, we put an allow condition if run originated from an API key we use since those would never be promoted runs.
Problem
No simple way to determine run promotion was used in the data payload.

Please authenticate to join the conversation.

Upvoters
Status

✅ Completed

Board

💡 Feature Requests

Tags

Access Control

Date

About 1 year ago

Subscribe to post

Get notified by email when there are changes.