zegocover / git-diff-conditional-buildkite-plugin Goto Github PK
View Code? Open in Web Editor NEWBuildkite plugin to dynamically skip steps based on git diff and labels
License: MIT License
Buildkite plugin to dynamically skip steps based on git diff and labels
License: MIT License
We've been using this plugin for awhile without issue, but just started consistently running into this error Error: The command exited with status 100
. I suspect it might be related to a recent (and faulty) change to the python:3.7-slim
docker image - issue here.
I'm not sure if we need to bump the plugin to use a different docker image or just wait for this to be patched, but wanted to report for anyone else seeing this.
The current method used to detect the master
branch diff, relies heavily on the assumption that merge commits are being used. If this is not the case, then it should be possible to pass a setting to the plugin to set how the master
branch is detected in order to check for diff.
Whilst it is possible to pass in your own diff_command
, this doesn't allow for detecting diff on a PR vs running on master as easily as it should.
master
branch detection is improved for various merge commit strategiesWhen passing a pipeline file containing a block
errors are thrown
steps:
- block: "Are you sure you want to continue?"
branches: "master"
- label: ":terraform: :man-running:"
command:
make awesome
branches: "master"
block
[2020-03-31T15:30:42Z] Traceback (most recent call last):
[2020-03-31T15:30:42Z] File "/usr/local/bin/generate_pipeline.py", line 239, in <module>
[2020-03-31T15:30:42Z] handler()
[2020-03-31T15:30:42Z] File "/usr/local/bin/generate_pipeline.py", line 230, in handler
[2020-03-31T15:30:42Z] dynamic_pipeline, conditions
[2020-03-31T15:30:42Z] File "/usr/local/bin/generate_pipeline.py", line 128, in generate_pipeline_from_conditions
[2020-03-31T15:30:42Z] step["skip"] = self.check_if_skip(conditions, step)
[2020-03-31T15:30:42Z] File "/usr/local/bin/generate_pipeline.py", line 137, in check_if_skip
[2020-03-31T15:30:42Z] label = step["label"]
[2020-03-31T15:30:42Z] KeyError: 'label'
[2020-03-31T15:30:43Z] ๐จ Error: The command exited with status 1
A pipeline file which has steps containing block
don't throw errors for a missing label
(Labels are not used for block
)
Numeric values with leading zeros are not being quoted when the generated pipeline file is being written to disk. Without the quotes, the subsequent buildkite-agent pipeline upload
command interprets the numeric as an integer and trims the leading zero, resulting incorrect values within the executed buildkite pipeline. This occurs even if the numeric is quoted.
In any buildkite step, for some step parameter, provide a numeric w/ a leading zero. Use plugin to generate pipeline. Observe failure.
Keep quotes around numerics with leading zeros.
When using the plugin, it is unable to locate the python file
[2020-03-31T10:55:24Z] $ /BUILDKITE_PLUGIN_PATH/github-com-Zegocover-git-diff-conditional-buildkite-plugin-v0-1-0/hooks/command
[2020-03-31T10:55:47Z] python3: can't open file 'scripts/generate_pipeline.py': [Errno 2] No such file or directory
[2020-03-31T10:55:47Z] ๐จ Error: The command exited with status 2
For this error to not happen
When a pipeline uses a wait step like the below, it will cause the plugin to blow up:
steps:
- wait: ~
continue_on_failure: true
dict
wait
steps with continue_on_failure
to work with the plugin
For a better description of what git-mirrors is, refer to this: https://github.com/buildkite/agent/blob/master/EXPERIMENTS.md
When running a build from an agent configured to use git-mirrors. The path setup isn't mounted into the container, this results in errors when checking for git diff
.
buildkite-agent
use git-mirrors
and observe errors when running git
commandsThe ability to pass an optional git-mirrors
path to the plugin, so that it gets mounted into the docker container as well as the current working directory
Pushing a build with any commit message that contains the string "BUILDKITE" will cause the command hook to fail with:
docker: poorly formatted environment: variable 'the line containing the string BUILDKITE' contains whitespaces.
See 'docker run --help'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.