Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

docs: clarify that make ensure-generated is a PR requirement#513

Merged
jackfrancis merged 3 commits intoAzure:masterfrom
mboersma:document-make-generate
Feb 15, 2019
Merged

docs: clarify that make ensure-generated is a PR requirement#513
jackfrancis merged 3 commits intoAzure:masterfrom
mboersma:document-make-generate

Conversation

@mboersma
Copy link
Member

@mboersma mboersma commented Feb 14, 2019

Reason for Change:

#449 failed to document that keeping generated files in sync is now a requirement for PRs submitted.

Issue Fixed:

Fixes #509

Requirements:

Notes:
This PR repeats some content so it's less likely to be missed. The root CONTRIBUTING.md document isn't really unified with those under docs/, so I allowed the repetition and linked from one to the other.

The script is already fairly explicit about what you need to do when there are diffs, so I didn't add any more exhortation in the Makefile:

...
> var _agentoutputsT = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x92\x4f\x4b\x03\x31\x10\xc5\xef\xfd\x14\xc3\x5e\xb6\x0b\x65\x7b\x6f\x4f\x45\x11\x16\xb1\x56\x7a\x14\x0f\xd9\xdd\x49\x49\x1b\x27\x35\x33\x5b\x29\x21\xdf\x5d\x36\xe0\x76\x95\xaa\x17\x2f\xf9\xf7\xc2\xbc\x37\xbf\x24\x04\xa3\xa1\xe2\x4d\x57\x5b\xd3\x40\xb9\x71\x5e\x38\xc6\x09\x40\x08\x60\x34\x90\x13\xa8\xf8\xbe\xab\xd1\x13\x0a\x32\x24\x0d\x20\x0b\xa1\x5c\xab\x57\x8c\xf1\xee\xe9\x76\x9d\x2d\x20\xa4\xe3\x24\xc9\xf9\x88\xd9\x02\x32\x16\x6f\x68\x97\xcd\x2e\xca\x49\xd9\x2e\x49\xcf\x1e\x35\x7a\xa4\x06\xa7\x8d\xa3\x46\xc9\x34\x7f\x30\x8d\x77\xec\xb4\x94\x6b\x94\x77\xe7\x0f\xf3\x63\xca\x54\x6d\x56\x6d\xeb\x91\x19\x79\x9e\xcf\xe0\xa4\xbc\x51\xb5\x45\x9e\xe6\x43\x84\xe1\x4a\xbf\xcd\x8b\xa2\x28\x5b\xe2\x2d\x8a\x18\xda\x71\xa9\xdf\x5a\x7a\xc9\x52\x88\x38\x4b\x8d\x21\xb5\x31\x4e\x2e\xb3\xd1\xa0\xa8\x85\xb2\xe2\xd5\x49\x19\xab\x6a\x63\x8d\xd8\xc3\x72\xbf\xb4\x87\xfd\x79\x8b\xc2\xbd\xb6\x15\xe7\xd5\x0e\x57\x4d\xe3\x3a\x92\xc4\xe1\x42\xe1\xab\xf8\xa8\x35\xa3\x8c\xa8\x0c\x4c\x0c\xc9\x00\x64\x84\xe3\x5a\x57\xd7\x4a\xe6\xc5\xb8\x93\x9f\x03\xdc\xf4\xc3\xbf\xfa\x73\x2a\xf9\x8b\x7f\x57\x13\x4a\xbf\xbe\x66\xfb\xed\x2b\xfc\xe5\x3c\xd4\x1a\xfb\x7d\xbe\xd7\x47\x00\x00\x00\xff\xff\x8f\x53\xda\xf6\xb2\x02\x00\x00")
+ echo 'go generate produced changes that were not already present.'
go generate produced changes that were not already present.
+ echo 'Make sure you include generated assets in your commit.'
Make sure you include generated assets in your commit.
+ exit 1
+ rm -rf /var/folders/tq/2cdy0tqn6g556ny243rx3p840000gn/T/tmp.wJESj3Wr

## Pull Requests and Generated Code

**Summary:** Always run `make ensure-generated` before you submit a pull request. If that command
returns an error, it will also have generated files that need to be included with the PR.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would ensure-generated return an error if it also resulted in the needed generated files? That sounds like something that would return 0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if the command fails, the PR author has more to do (commit the files and try again). So it returns an error return code.

Since it had to generate the files in order to know if there's a diff, the simplest path is to have the user just commit the files already generated. Committing what could be seen as a side effect does seem odd, which was the motivation for renaming the make target to ensure-generated.

@codecov
Copy link

codecov bot commented Feb 14, 2019

Codecov Report

Merging #513 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #513   +/-   ##
=======================================
  Coverage   54.39%   54.39%           
=======================================
  Files          97       97           
  Lines       14570    14570           
=======================================
  Hits         7925     7925           
  Misses       5971     5971           
  Partials      674      674

@tariq1890
Copy link
Contributor

Thanks so much for this @mboersma. Can we add an extra step in the PR template to highlight this requirement?

displayName: Run linting rules
workingDirectory: $(modulePath)
- script: make validate-generated
- script: make ensure-generated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wohoo!

@mboersma
Copy link
Member Author

Can we add an extra step in the PR template to highlight this requirement?

Yes indeed. I will add that.

@jackfrancis
Copy link
Member

/lgtm

@acs-bot acs-bot added the lgtm label Feb 15, 2019
@jackfrancis jackfrancis merged commit daf9e38 into Azure:master Feb 15, 2019
@acs-bot
Copy link

acs-bot commented Feb 15, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis, mboersma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [jackfrancis,mboersma]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

tariq1890 pushed a commit to tariq1890/aks-engine that referenced this pull request Feb 20, 2019
sylr pushed a commit to sylr/aks-engine that referenced this pull request Feb 28, 2019
juhacket pushed a commit to juhacket/aks-engine that referenced this pull request Mar 14, 2019
@mboersma mboersma deleted the document-make-generate branch June 21, 2019 19:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need to document or punt on committing generated files

4 participants