Skip to content

Combine Drone release steps #9338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 15, 2019

Conversation

silverwind
Copy link
Member

See #9324. I don't know if this will fix the issue but it seems worth a try to land this on master just to watch the release-master task run. If it does not work out, we can revert it.

@codecov-io
Copy link

codecov-io commented Dec 12, 2019

Codecov Report

Merging #9338 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9338      +/-   ##
==========================================
- Coverage   41.42%   41.41%   -0.01%     
==========================================
  Files         568      568              
  Lines       74045    74045              
==========================================
- Hits        30671    30669       -2     
- Misses      39547    39552       +5     
+ Partials     3827     3824       -3
Impacted Files Coverage Δ
modules/indexer/code/indexer.go 44.73% <0%> (-10.53%) ⬇️
modules/process/manager.go 74.69% <0%> (-3.62%) ⬇️
services/pull/check.go 55.3% <0%> (-2.28%) ⬇️
models/gpg_key.go 55.59% <0%> (+0.55%) ⬆️
models/repo_list.go 74.07% <0%> (+0.92%) ⬆️
modules/log/file.go 77.62% <0%> (+2.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60b31c8...d693e47. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 12, 2019
@lafriks
Copy link
Member

lafriks commented Dec 12, 2019

I don't see how this does change things as checked out directory are shared between steps except if there are not in the same pipeline. Also imho js/css build step should be in different drone step

@silverwind
Copy link
Member Author

silverwind commented Dec 13, 2019

Yes, they should be shared but the only logical explanation for #9324 is that they aren't for some reason.

I do think it should be possible to produce a working release locally via make release and not only via CI, so I see the release task dependencies as must-haves (minus GPG sign currently, but that could also be moved to make).

@techknowlogick
Copy link
Member

techknowlogick commented Dec 14, 2019

So embedding works (we can see this with vendor'd css/js, as well as templates are embedded, this means go generate with bindata env is working.

I'm hesitant to merge this without testing, luckily drone allows us to run specific pipelines via CLI. I will test this change via CLI (which will allow me to also put in some debugging into drone that'll show more info (ex. ls of a specific dir before running make release)

Edit: woops. I had this page loaded up before your most recent comment @silverwind, I had same thought except after you :)

@zeripath
Copy link
Contributor

This change means we lose testing on node10 doesn't it?

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

Just ran drone exec --pipeline release-master with the changes I suggested to this PR and it builds as expected.

Thank you for this PR @silverwind :)

@techknowlogick
Copy link
Member

@zeripath nope, this is just for the release steps, the node10 container is still in the testing pipeline.

@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Dec 14, 2019
@axifive
Copy link
Member

axifive commented Dec 14, 2019

@techknowlogick Can you also debug an existing step in master? To understand why it's not worked, maybe this can help avoid similar errors in the future.

@techknowlogick techknowlogick added this to the 1.11.0 milestone Dec 14, 2019
@techknowlogick
Copy link
Member

Oh, I know what's going on! I can't believe I missed it. The build & static step are run at the same time, this means that even though the files exist where they should, the go generate command ends up being run before the JS/CSS files are finished being generated. the "depends_on" needs to be removed from each step in the release pipelines to force each step to be run in sequence.

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

Blocking per my most recent comment.

@silverwind
Copy link
Member Author

@techknowlogick thanks for finding it. It's now clear to me that as soon as a depends_on is introduced, drone will parallelize (https://docker-runner.docs.drone.io/configuration/parallelism/). I went ahead and removed all depends_on in the release pipelines so they should now always serialize.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 15, 2019
Fixes missing JS/CSS because drone did unwanted parallelization of the
js/css task and the generate task. Combined the tasks into one and made
'make release' work standalone.

Fixes: go-gitea#9324
Fixes: go-gitea#9362
@silverwind
Copy link
Member Author

Squashed and added new commit message.

@silverwind
Copy link
Member Author

One more tweak pushed which make js css dependencies of generate. This fixes the case wheremake generate build (which some people have in their build scripts) would result in generate running only once and too early.

@silverwind
Copy link
Member Author

silverwind commented Dec 15, 2019

One more tweak: Removed useless go-all target. Now go-check only runs once instead of twice and before generate.

The go target could potentially also be removed but I kept it because it allows for quicker building without generate. Thought, the same could also be achieved using make gitea.

@silverwind
Copy link
Member Author

go target removed as well for simplicity's sake. One can still run make gitea (make gitea.exe on Windows) to achieve the same.

@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 15, 2019
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Dec 15, 2019
@techknowlogick
Copy link
Member

Thanks @silverwind for all of your work on this :)

@techknowlogick techknowlogick merged commit 7217b70 into go-gitea:master Dec 15, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants