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

fix: commit generated go-bindata files with "--no-compress" option#1088

Merged
acs-bot merged 6 commits intoAzure:masterfrom
andyliuliming:andliu/go_bin_data
May 13, 2019
Merged

fix: commit generated go-bindata files with "--no-compress" option#1088
acs-bot merged 6 commits intoAzure:masterfrom
andyliuliming:andliu/go_bin_data

Conversation

@andyliuliming
Copy link
Member

so do go-bindata here will help projects which vendored aks-engine.
and add no-compress option to go-bindata, so we will not need to rebase it everytime.

Reason for Change:

Issue Fixed:

Requirements:

Notes:

@mboersma
Copy link
Member

mboersma commented Apr 18, 2019

/azp run pr-e2e

add no-compress option to go-bindata, so we will not need to rebase it everytime

👍 That's awesome if the fix is something simple like that we have overlooked.

@azure-pipelines
Copy link

For the Azure DevOps organization aks-engine, no matching pipelines using the Azure Pipelines app were found for this pull request.

@mboersma
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jackfrancis
Copy link
Member

Just to be clear, the only de-optimization from this change will be the storage overhead of this file in the repo? ( And also to github's backend merge conflict validation service :| )

@andyliuliming
Copy link
Member Author

andyliuliming commented Apr 20, 2019

Just to be clear, the only de-optimization from this change will be the storage overhead of this file in the repo? ( And also to github's backend merge conflict validation service :| )

yes, and the file size is not too big. so I think it's acceptable?

and for the future change, we can also verify if we change the files under "parts" folder, and the real change shows in the go files too,
before this change, the content is compressed, and not readable and we can only trust it :)

@mboersma
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Apr 23, 2019

Codecov Report

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

@@           Coverage Diff           @@
##           master    #1088   +/-   ##
=======================================
  Coverage   74.81%   74.81%           
=======================================
  Files         128      128           
  Lines       18318    18318           
=======================================
  Hits        13705    13705           
  Misses       3829     3829           
  Partials      784      784

@jackfrancis
Copy link
Member

How often do we generate pkg/i18n/translations_generated.go? Should we add --no-compress to that as well?

@andyliuliming
Copy link
Member Author

andyliuliming commented Apr 24, 2019

How often do we generate pkg/i18n/translations_generated.go? Should we add --no-compress to that as well?

do not know how often that file would be generated :)
this file is genearted by pkg/i18n/resourceloader.go
and '--no-compress' is added there too.

@andyliuliming
Copy link
Member Author

Hi @jackfrancis @mboersma , could you please help merge this PR if no other comments? so I can do the according change in ACSRP repo. thanks.

@jackfrancis
Copy link
Member

@mboersma to validate docs and E2E changes I just made

Copy link
Member

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

This looks good to me, although we should be willing to revert if we run into real-world race conditions again.

Copy link
Member

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

@acs-bot acs-bot added the lgtm label Apr 25, 2019
@mboersma mboersma changed the title fix: go mod would not copy the non-go files by default fix: commit generated go-bindata files with "--no-compress" option Apr 25, 2019
@CecileRobertMichon
Copy link
Contributor

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1. Once the PR is approved and the end-to-end job has passed, the PR can now be merged into the master branch
1. Once merged, another job is triggered to verify integrity of the master branch. This job is similar to the PR job.

## Pull Requests and Generated Code
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@mboersma
Copy link
Member

It's failing the ensure-generated check now. :-(

/lgtm cancel

@jackfrancis
Copy link
Member

// TODO we need to add PR validation that confirms the hygiene of the source against the generated code within the fork/branch itself. Until then we can't move this forward.

@andyliuliming
Copy link
Member Author

@jackfrancis @mboersma I took a look at the ensure-generated, I think that will protect us from the case that the generated go file not update to date. will generate the file again and pushing.

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mboersma
Copy link
Member

@andyliuliming I'm still worried that this will create a situation that requires PRs to be rebased often in order to pass make ensure-generated.

Overall it seems that /parts is the most active area of change in the project, and any time something changes under that directory, the generated code needs to be updated. Once that's done, make ensure-generate will no longer pass for existing PRs: they will all need to be rebased against master.

This situation has happened before and it is a frustrating cycle that repels contributors. We absolutely don't want to do that—AKS Engine is better served by making it easy for people to contribute even if it means our Go packaging is slightly clumsy.

I'm trying to think of ways around this but don't have any fresh ideas.

@andyliuliming
Copy link
Member Author

Hi @mboersma I suppose each PR-e2e build in VSTS will do
pull the master and apply the commits in a seperate branch (just like the rebasing) and then run the tests, ours pipeline did not do that?

@CecileRobertMichon
Copy link
Contributor

Even if the pipeline does merge master before running the tests, developers will still run into merge conflicts (thus requiring a rebase) every time they change one of the files that requires an update to the generated code (eg. parts/). Running the pipeline tests on a rebased branch will only help make ensure-generated pass when no file that requires files to be generated was changed.

@andyliuliming
Copy link
Member Author

Even if the pipeline does merge master before running the tests, developers will still run into merge conflicts (thus requiring a rebase) every time they change one of the files that requires an update to the generated code (eg. parts/). Running the pipeline tests on a rebased branch will only help make ensure-generated pass when no file that requires files to be generated was changed.

"developers will still run into merge conflicts (thus requiring a rebase) every time they change one of the files that requires an update to the generated code (eg. parts/)"

I think the git will do the auto-merge for us if there's no real code conflict after this code change.
we can do a test.

@andyliuliming
Copy link
Member Author

andyliuliming commented May 7, 2019

@mboersma @CecileRobertMichon any updates?
do you mind grant me the permission to trigger the pipeline, so I can do a test if the "merge conflicts" will happen(probably it won't happen) on a separate branch.

I think the reason the git could not do the auto-merge just because we do not set the no-compress option.

and after this change, say if someone changed the file in the parts file.

then the diff for the go code generated would be like:

+ code change one
- code change two

and the git will do the auto-merging for us.

@CecileRobertMichon
Copy link
Contributor

@andyliuliming I've granted you write access you should now be able to trigger the pipeline using /azp run pr-e2e. (you don't need to trigger the pipeline to see if there are merge conflicts though, opening a PR is enough).

@mboersma
Copy link
Member

mboersma commented May 9, 2019

I do think git will merge changes in the generated files correctly in most cases. The bottleneck will be the make ensure-generated task.

Azure DevOps merges the branch into master before running tests, so any changes in master that haven't been incorporated into your branch will cause make ensure-generated to fail, since it will regenerate the files and there will be a diff. Then you need to rebase against master and force-push—and hope that no other changes to parts/ have been committed to master in the meantime.

(I may be wrong: this chicken-egg situation is confusing.)

@CecileRobertMichon
Copy link
Contributor

#1255 seems to suggest that this is working

@mboersma
Copy link
Member

#1255 seems to suggest that this is working

Yes...it does. I am happy to be wrong if so.

In that case I'm LGTM on this so long as we revert if it does somehow cause hassle for developers.

@CecileRobertMichon
Copy link
Contributor

CecileRobertMichon commented May 10, 2019

In that case I'm LGTM on this so long as we revert if it does somehow cause hassle for developers.

+ 1

@jackfrancis
Copy link
Member

/lgtm

we'll monitor this in the coming days to ensure it doesn't increase rate of master merge conflicts

@acs-bot acs-bot added the lgtm label May 13, 2019
@acs-bot acs-bot merged commit 39c2a4f into Azure:master May 13, 2019
@acs-bot
Copy link

acs-bot commented May 13, 2019

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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

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.

5 participants