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

Do not run clone step if no pipeline step will run #932

Closed
wants to merge 28 commits into from

Conversation

qwerty287
Copy link
Contributor

@qwerty287 qwerty287 commented May 19, 2022

  1. Fix empty build link
  2. Fix issue if not all builds are skipped

TODO:

Closes #778

@6543 6543 added bug Something isn't working skip-changelog labels May 19, 2022
@6543 6543 added this to the 1.0.0 milestone May 19, 2022
@6543
Copy link
Member

6543 commented May 20, 2022

I did revert #877 via e2e094c

you can add it back in this pull - it need just more work ...

PS: this patch do not solve the underlaying issue

@codecov-commenter

This comment was marked as outdated.

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
@6543 6543 changed the title Fix some issues for skipped clones Do not run clone step if no pipeline step will run May 20, 2022
@qwerty287 qwerty287 added feature add new functionality and removed bug Something isn't working labels May 20, 2022
@6543 6543 added the wip label May 30, 2022
@anbraten anbraten mentioned this pull request Jun 8, 2022
3 tasks
@6543
Copy link
Member

6543 commented Jun 15, 2022

@qwerty287 #949 should make the whole pipeline functions way more readable :)

@qwerty287
Copy link
Contributor Author

qwerty287 commented Jul 3, 2022

After I tried this for a while, I was finally able to reproduce it and it looks like I found the issue: if a pipeline depends_on another one, but the one it depends on is skipped because it only contains the clone step, the pipeline was marked as "invalid" and removed because this pipeline doesn't occur in the list of pipelines that will run (because it doesn't contain any steps). To fix this, I changed the behavior of what happens if a dependency is missing: don't remove the pipeline completely, but remove the dependency instead and run it anyway. This fixed the issue for me. Is this fine or should it follow the old behavior and the pipeline is skipped? This is harder and requires more code. The current approach would be breaking.

@qwerty287 qwerty287 removed the wip label Jul 3, 2022
@qwerty287
Copy link
Contributor Author

I pushed some commits that restore the old handling, but the issue is fixed. I also added a test to test the skipped clone.

@qwerty287 qwerty287 requested a review from a team July 20, 2022 07:28
@qwerty287
Copy link
Contributor Author

qwerty287 commented Aug 3, 2022

@woodpecker-ci/Maintainers Would be nice if you could review this PR :)

@6543

This comment was marked as outdated.

Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

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

😆 It's still broken :/

@6543
Copy link
Member

6543 commented Aug 25, 2022

to reproduce:

  1. clone this repo into your local test env
  2. enable ci for it
  3. change a line in Makefile

expect:

  • multible piplenes still run like "docker"
    get:
  • only "test" runn and report build successfull

@6543
Copy link
Member

6543 commented Aug 25, 2022

at some point I'll also have a look at this ... as I dislike how global pipeline filter do (internaly) work atm

@anbraten
Copy link
Member

I had a look and debugged it as well a few days / maybe even weeks ago (sorry for that). I also experienced some issues with it while testing. In general this is pretty related to #770 and I would like to have a more generic way of checking dependencies and if a required pipeline (depends_on) failed / is existing at all. Having properties like isEmpty / skippedClone sounds a bit to specific to me right now 🙈

@qwerty287
Copy link
Contributor Author

So just close this and fix it later?

@anbraten
Copy link
Member

anbraten commented Aug 28, 2022

Okay lets write down the cases again as I am not sure how you planned on handling each specific:

  • pipeline is required by depends_on, but hasn't been defined at all (typo, not added yet) => the config is marked as wrong by the linter?!
  • pipeline is required by depends_on, but was skipped as it was empty / only clone steps => treat as successful
  • pipeline is required by depends_on, but was skipped as it hasn't matched root.when Add support for pipeline root.when conditions #770) => skip dependent pipelines as well
  • pipeline is required by depends_on, but was failing => stop pipeline execution and skip dependent pipelines
  • pipeline is required by depends_on and was successful => go on

@qwerty287
Copy link
Contributor Author

pipeline is required by depends_on, but hasn't been defined at all (typo, not added yet) => the config is marked as wrong by the linter?!

The corresponding depends_on is ignored completely, not sure if the linter says something.

pipeline is required by depends_on, but was skipped as it was empty / only clone steps => treat as successful?

Yes, treated as successful.

pipeline is required by depends_on, but was skipped as it hasn't matched root.when
#770) => skip dependent pipelines or treat as successful?

Dependent pipelines are skipped as well.

@anbraten
Copy link
Member

Nice. I have updated my comment.

The corresponding depends_on is ignored completely, not sure if the linter says something.

I just checked it. The linter is not checking that a depends_on target pipeline exists, but I think that would be a helpful additional feature for another PR.

@qwerty287
Copy link
Contributor Author

I'm going to close this. If somebody refactors the pipeline compiling, it would be good to look into this again.

@qwerty287 qwerty287 closed this Sep 25, 2022
@qwerty287 qwerty287 deleted the empty-status branch March 19, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature add new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not run clone step if no pipeline step will run
4 participants