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
Current convention has mostly been not to stage/commit changes to files in generated when submitting PRs. In the most frequent case of adding a single item to customDefinitions.d.ts, this often leads to single small commits (example) titled "Update generated files" which are just copying over the custom definition to the generated file. For the git blame, it would be better if these were part of the PR itself.
I can think of two solutions:
Just have authors do it themselves
If we enforce this as a requirement, it becomes tedious to use the web editor for one line changes; You could make the change, but would then have to pull the branch locally to build the generated output.
If we don't enforce it as a requirement, commits can become inconsistent, with some updating generated while others still create an update commit after the PR.
There is a small risk of malicious changes in the generated going unspotted during PR review. I don't think this would be a major risk, as the automatic generation on master would run directly after and fix the malicious files? But it's still worth pointing out.
Have a CI job run and commit the generated output to the PR branch automatically
Seems like a great solution, but is it viable?
This solves the risk in 1.iii, as long as the job runs consistently and is checked for failure.
How do we handle the case of people unchecking the Allow edits by maintainers option? I believe this would mean the CI job can't commit either. This basically falls back to the consideration in 1.i and 1.ii, although 1.iii shouldn't be a problem as long as the CI job still does a diff check when it fails the commit permissions.
The text was updated successfully, but these errors were encountered:
*Alternatively, we could have option 2 only apply to .d.ts changes (like customDefinitions.d.ts), which would get around the risks of running arbitrary PR code. I don't think this will be necessary though if we set up the two-workflow example correctly.
Current convention has mostly been not to stage/commit changes to files in
generated
when submitting PRs. In the most frequent case of adding a single item tocustomDefinitions.d.ts
, this often leads to single small commits (example) titled "Update generated files" which are just copying over the custom definition to the generated file. For thegit blame
, it would be better if these were part of the PR itself.I can think of two solutions:
generated
while others still create an update commit after the PR.generated
going unspotted during PR review. I don't think this would be a major risk, as the automatic generation on master would run directly after and fix the malicious files? But it's still worth pointing out.Allow edits by maintainers
option? I believe this would mean the CI job can't commit either. This basically falls back to the consideration in 1.i and 1.ii, although 1.iii shouldn't be a problem as long as the CI job still does a diff check when it fails the commit permissions.The text was updated successfully, but these errors were encountered: