pyasi / pybuildkite Goto Github PK
View Code? Open in Web Editor NEWA Python library for the Buildkite API
Home Page: https://github.com/pyasi/pybuildkite
License: BSD 2-Clause "Simplified" License
A Python library for the Buildkite API
Home Page: https://github.com/pyasi/pybuildkite
License: BSD 2-Clause "Simplified" License
Let's add the functionality provided in the documentation for the Teams endpoint here
The create_yaml_pipeline
method is missing many parameters listed at https://buildkite.com/docs/apis/rest-api/pipelines#create-a-yaml-pipeline. These all need to be added. Alternatively, I would actually recommend just accepting kwargs for all parameters that don't need any further formatting. Then the Python package can be robust to changes to the Buildkite API with minimal maintenance. This comes at the cost of a more self-documenting Python API, but given the lack of activity on this repo I think it would be better to just point to the Buildkite documentation as the source of truth.
Create a method for the Add a Webhook functionality
pipelines.py
to use the endpoint described aboveSometimes I see my jobs fail to submit due to a network transient error. If you use requests.Session
with a reasonable default of retries (3?) it should address the vast majority of these issues.
Pipelines, Builds, Jobs, and Agents are all currently only using GET endpoints. We need full CRUD ability, adding POST, PUT, and DELETE functionality to these to make them feature complete would be great. Doesn't have to be all in one PR.
It would be great if pybuildkite shipped with type stubs included so that consuming projects could use mypy to ensure that they are using valid fields/functions on pybuildkite objects
I was inspired by PyGithub's most recent release shipping with pyi
stub files included with the package. They are still in the process of updating their CI process to keep the pyi files up-to-date with the source code.
I'd be willing to help out with getting the type information in pybuildkite, but was wondering what kind of approach would you want to take? .pyi
files, or in-line type hints -- any desire to keep python 2 compatibility?
Latest GitHub release is 1.2.1, latest pypi release is 1.2.2 - these should be brought in sync.
Hi,
I am trying to list builds based on the value of meta_data variables:
builds = buildkite.builds().list_all_for_pipeline(org_name,
pipeline_name,
meta_data={'origin_id': 0}
)
but it seems that pybuildkite is building the url as ...?metadata={'origin':0}&...
instead of ...?metadata[origin]=0&...
as defined in Buildkite API documentation.
I checked the unit tests but there doesn't seem to have anything using it.
If this is indeed a bug I would be happy to make a PR to fix it.
Create a new file and class to incorporate the meta API.
meta.py
Just curious if it's intentionally not public
Due to following line the state query param looks like passed
instead of state=passed
pybuildkite/pybuildkite/builds.py
Line 316 in 59db85d
pls add: state=
+
If you use a datetime object including tzinfo e.g.
from datetime import datetime, deltatime
from datetime impor timezone
UTC = timezone.utc
finished_from = datetime.now(UTC)-deltatime(days=1)
then you'll get an error because the api endpoint will be wrong generated
It appears that the list_annotations()
wrapper is not paginated, since it does not accept page
or with_pagination
parameters as the other paginated wrappers do.
Related to #85, the code in the 1.2.2 PyPi release doesn't actually match the code from the 1.2.2 GitHub release. PyPi 1.2.2 looks like it was released December 20th, whereas the GitHub release was January 13th. Could you create a new release on PyPi and GitHub (either 1.2.3 or 1.3.0) so that the codebase is aligned? 🙏
The API provides support for updating a pipeline via PATCH
: https://buildkite.com/docs/apis/rest-api/pipelines#update-a-pipeline
This doesn't seem to be supported by the library yet (the base client also doesn't provide a PATCH
method, so the only way to update a pipeline currently is using the rest API directly as far as I can tell).
https://buildkite.com/changelog/99-introducing-the-yaml-steps-editor
After migrating to YAML steps, create_pipeline() no longer works.
Buildkite throws an HTTP 500 error when trying to use
buildkite.pipelines().create_pipeline(
organization = "org",
pipeline_name = "pipeline",
git_repository = "[email protected]:pyasi/pybuildkite.git"
)
Error
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://api.buildkite.com/v2/organizations/dropbox/pipelines/?per_page=100
The same error can be reproduced using curl
.
In order to create a pipeline, we must use the new param configuration
in https://buildkite.com/docs/apis/rest-api/pipelines#create-a-pipeline-yaml-pipelines
I believe that the functions list_artifacts_for_job
and list_artifacts_for_build
are inverted:
pybuildkite/pybuildkite/artifacts.py
Lines 19 to 42 in 5662972
The list_artifacts_for_build
should not need a job
, only the build
. The function that gets a job
should be list_artifacts_for_job
.
This is also in line with the API docs: https://buildkite.com/docs/apis/rest-api/artifacts
I would also be happy to open a PR for this one
Hi, I am trying to load all our builds via
buildkite.builds().list_all
This returns the first 100 results (as expected)
but I can't figure out if there is a way to get the next 100 results.
It would be great if a new release could be issued, as I'm looking forward to using this improvement 🙏 #82
A majority of the docstrings in these classes are not filled out. It would be great to document each class and method.
https://buildkite.com/changelog/215-upcoming-change-to-the-buildkite-api
Will there be a SDK release that includes the changes?
tests/test_client.py::TestClientRequest
can fail when running with pytest --randomly-seed=1234
or pytest --randomly-seed=123
.
Create a new file and class to incorporate the Access Token API
access_token.py
Let's get this repo to be complete with all opened API functionality provided by Buildkite. Does not have to be a single PR.
Let's add the functionality provided in the documentation for the Users endpoint here
This repository needs tests for each of the Buildkite API functions i.e agents.py
or jobs.py
.
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.