Skip to content
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

Don't run build and test if only docs changed #24530

Merged
merged 6 commits into from
May 16, 2023

Conversation

lunny
Copy link
Member

@lunny lunny commented May 5, 2023

As title.

But maybe it's affected by actions/runner#2324

@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label May 5, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 5, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 5, 2023
@lunny lunny requested a review from techknowlogick May 5, 2023 01:36
@techknowlogick
Copy link
Member

Seems fine with me, but I'm not sure how the "required checks" will work if we skip the required checks.

@lunny
Copy link
Member Author

lunny commented May 5, 2023

Seems fine with me, but I'm not sure how the "required checks" will work if we skip the required checks.

Ah, yes. Gitea actions will also encounter this like problem.

@yardenshoham
Copy link
Member

Seems fine with me, but I'm not sure how the "required checks" will work if we skip the required checks.

Relevant documentation page: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks#handling-skipped-but-required-checks

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 14, 2023
@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 May 14, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 14, 2023
@yardenshoham yardenshoham added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 14, 2023
test-pgsql:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"'
Copy link
Member

Choose a reason for hiding this comment

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

extra ' at the end of this line

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.

few minor things

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels May 14, 2023
@yardenshoham yardenshoham removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 14, 2023
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 16, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels May 16, 2023
@techknowlogick techknowlogick added skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels May 16, 2023
@techknowlogick techknowlogick enabled auto-merge (squash) May 16, 2023 02:27
@techknowlogick techknowlogick merged commit c78b923 into go-gitea:main May 16, 2023
@GiteaBot GiteaBot added this to the 1.20.0 milestone May 16, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 16, 2023
@lunny lunny deleted the lunny/ignore_docs branch May 16, 2023 02:54
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 16, 2023
* giteaofficial/main:
  Fix WEBP image copying (go-gitea#24743)
  Reorganize CSS files (go-gitea#24739)
  Don't run build and test if only docs changed (go-gitea#24530)
  [skip ci] Updated translations via Crowdin
  Rework Oauth login buttons, swap github logo to monocolor (go-gitea#24740)
  Implement systemd-notify protocol (go-gitea#21151)
  Bump vm2 from 3.9.17 to 3.9.18 (go-gitea#24742)
  Refactor Pull Mirror and fix out-of-sync bugs (go-gitea#24732)
  Unification of registration fields order (go-gitea#24737)
  Switch to `@eslint-community/eslint-comments` (go-gitea#24736)
  Docs for creating a user to run Gitea on Fedora/RHEL/CentOS (go-gitea#24725)
@yardenshoham
Copy link
Member

Check #24757

lunny added a commit that referenced this pull request May 17, 2023
@silverwind
Copy link
Member

silverwind commented May 22, 2023

This has some kind of regression where docs build no longer runs for PRs:

PR build was skipped with "No build required" introduced from this PR:

https://github.com/go-gitea/gitea/actions/runs/5039932080/jobs/9038389389

It subsequently failed on main when landed and the docs build actually ran:

https://github.com/go-gitea/gitea/actions/runs/5040058905/jobs/9038577074

@silverwind
Copy link
Member

silverwind commented May 22, 2023

IDK, this whole config seems far too complex to me, I won't debug any further. Why do we even have actions that do nothing? What is the point of them? Do they override same-named actions?

@silverwind
Copy link
Member

@lunny revert this? It obviously wasn't tested enough, and I'd rather run too many actions than too few.

@lunny lunny mentioned this pull request May 22, 2023
@lunny
Copy link
Member Author

lunny commented May 22, 2023

@lunny revert this? It obviously wasn't tested enough, and I'd rather run too many actions than too few.

We can't test it unless we merge it. I think the problem is at compliance-docs, I ever have a discuss with @techknowlogick at #24761 (comment).

@silverwind
Copy link
Member

silverwind commented May 23, 2023

Besides it not working, there is more wrong with this PR:

  • It introduced duplicate workflow names, making the workflow overview confusing.
  • A clean design should not need workflows that do nothing
image

So I would still go for a clean revert.

BTW, in theory you can test locally with https://github.com/nektos/act.

@lunny
Copy link
Member Author

lunny commented May 23, 2023

Besides it not working, there is more wrong with this PR:

* It introduced duplicate workflow names, making the workflow overview confusing.

* A clean design should not need workflows that do nothing
image

So I would still go for a clean revert.

BTW, in theory you can test locally with https://github.com/nektos/act.

The change is based on #24530 (comment)

@silverwind
Copy link
Member

Seems like a huge hack. I'm surprised GH docs even recommend it. Maybe it could still be one workflows and the skip condition could be determined via a shell script instead.

@silverwind
Copy link
Member

https://github.com/dorny/paths-filter or similar might be better solutions.

techknowlogick pushed a commit that referenced this pull request May 25, 2023
Inspired by
#24530 (comment)

This PR use a file filter action to do different CI jobs according
changed files types. All types are defined in
`.github/file-filters.yml`. Now there are 4 types, `docs`, `backend`,
`frontend` and `build`. Then if a PR only changed docs files, those CI
jobs which passed the conditions will run, and other types are also like
this.

---------

Co-authored-by: silverwind <me@silverwind.io>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 14, 2023
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. 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.

5 participants