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

Add support for pipeline root.when conditions #770

Merged
merged 86 commits into from
Sep 26, 2022

Conversation

LamaAni
Copy link
Contributor

@LamaAni LamaAni commented Feb 9, 2022

close #283
close #688

As a ci user I would like to set a file/yaml global when condition, to disable pipeline runs. This allows easier to write control for the pipeline events, branches and metadata.

Changes

Fixes

  1. In hook.go, when one of the yaml(s) was filtered by branch the hook would not fire. Changed to if all are filtered hook is not fired.
  2. changed function name 'branchFiltered' -> 'checkIfFiltered'

@6543 6543 added this to the 1.0.0 milestone Feb 9, 2022
@6543 6543 added breaking will break existing installations if no manual action happens feature add new functionality labels Feb 9, 2022
@6543 6543 mentioned this pull request Feb 9, 2022
7 tasks
@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2022

Codecov Report

Merging #770 (2695014) into master (7db7e97) will increase coverage by 0.14%.
The diff coverage is 100.00%.

❗ Current head 2695014 differs from pull request most recent head d6d0f9e. Consider uploading reports for the commit d6d0f9e to get more accurate results

@@            Coverage Diff             @@
##           master     #770      +/-   ##
==========================================
+ Coverage   49.57%   49.71%   +0.14%     
==========================================
  Files          86       86              
  Lines        6548     6557       +9     
==========================================
+ Hits         3246     3260      +14     
+ Misses       3111     3106       -5     
  Partials      191      191              
Impacted Files Coverage Δ
server/shared/procBuilder.go 85.13% <100.00%> (+0.51%) ⬆️
server/logging/log.go 54.65% <0.00%> (+5.81%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

pipeline/frontend/yaml/config.go Outdated Show resolved Hide resolved
server/shared/procBuilder.go Outdated Show resolved Hide resolved
server/api/hook.go Outdated Show resolved Hide resolved
server/api/hook.go Outdated Show resolved Hide resolved
pipeline/frontend/yaml/compiler/compiler.go Outdated Show resolved Hide resolved
server/api/hook.go Outdated Show resolved Hide resolved
@anbraten

This comment was marked as outdated.

@6543

This comment was marked as outdated.

@anbraten

This comment was marked as resolved.

@anbraten anbraten mentioned this pull request Aug 10, 2022
3 tasks
@anbraten anbraten changed the title Added support for pipeline yaml root.when Added support for pipeline root.when conditions Aug 11, 2022
@6543
Copy link
Member

6543 commented Sep 1, 2022

I think this should do it, but I like to have some more unit tests for pipeline.when filters ...
... so when I do refactor It wont break

@anbraten anbraten changed the title Added support for pipeline root.when conditions Add support for pipeline root.when conditions Sep 2, 2022
pipeline/frontend/yaml/constraint/constraint.go Outdated Show resolved Hide resolved
pipeline/frontend/yaml/constraint/constraint.go Outdated Show resolved Hide resolved
server/pipeline/filter.go Outdated Show resolved Hide resolved
pipeline/frontend/yaml/compiler/compiler.go Outdated Show resolved Hide resolved
pipeline/frontend/yaml/constraint/constraint.go Outdated Show resolved Hide resolved
pipeline/frontend/yaml/constraint/constraint.go Outdated Show resolved Hide resolved
pipeline/frontend/yaml/constraint/constraint.go Outdated Show resolved Hide resolved
server/pipeline/filter.go Outdated Show resolved Hide resolved
server/pipeline/filter.go Outdated Show resolved Hide resolved
@6543
Copy link
Member

6543 commented Sep 19, 2022

conflicts ...

@anbraten anbraten enabled auto-merge (squash) September 26, 2022 06:50
@anbraten anbraten merged commit ec9b0a6 into woodpecker-ci:master Sep 26, 2022
@anbraten anbraten mentioned this pull request Sep 30, 2022
simmstein pushed a commit to simmstein/woodpecker that referenced this pull request Dec 27, 2022
Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: 6543 <6543@obermui.de>
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.

global pipeline filter should behave on multi-pipeline same Use when keyword for pipeline conditions
5 participants