bridgecrewio / yor

Extensible auto-tagger for your IaC files. The ultimate way to link entities in the cloud back to the codified resource which created it.
https://www.yor.io
Apache License 2.0
827 stars 123 forks source link

Question: how to have git revision metadata survive PR squash-merge? #305

Closed petemounce closed 1 year ago

petemounce commented 2 years ago

We have a TF configuration repository.

We have a policy of "plan from PR; apply from master".

Code review and CI pass are mandated ahead of merge. GitHub source control + CI.

PR is squash-merge only.

In this scenario - are there ways we could make the yor happen pre-merge, but survive the squash-merge of PRs? That squash-merge means that the individual commits of branches are now rewritten and unreachable.

We would like to not TF-apply from JIT-modified-and-not-source-controlled, because we want to maintain the git log as source of truth.

Is this combination of constraints soluble...?

nimrodkor commented 2 years ago

Hey @petemounce ! I wonder if all the tags are really relevant for you in that case. Because between the branch and the squashed commit, there would be only changes in the git_commit tag, git_last_modified_at and possibly git_modifiers and git_last_modified_by.

Perhaps you can run a combination of specific tags per commit on every branch, and then the rest of the tags that you wish to add only on the master branch?

WDYT?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.