Giter VIP home page Giter VIP logo

pybuildkite's People

Contributors

aaronsky avatar aitorres avatar alex-torok avatar asheidan avatar assafgi avatar bbbthunda avatar changusmc avatar dependabot[bot] avatar enricomi avatar fd-jonathanlinn avatar fhightower avatar jmelahman avatar jnewbigin avatar justnoise avatar kristofersoler avatar ltriant avatar mwgamble avatar navneet78 avatar purplebooth avatar pyasi avatar savithakj avatar sup3rgeo avatar zulinx86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pybuildkite's Issues

Missing parameters for pipeline creation

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.

Add automatic retries for transient errors

Sometimes 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.

Add mypy type hints

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?

meta_data attribute

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.

Datetime object with tzinfo failed to get pybuildkite.builds.Builds

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

list_annotations() is not paginated

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.

PyPi 1.2.2 does not match GitHub 1.2.2

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? 🙏

Add support for YAML Pipeline

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

Inverted job and build functions for list_artifacts

I believe that the functions list_artifacts_for_job and list_artifacts_for_build are inverted:

def list_artifacts_for_job(self, organization, pipeline, build):
"""
Returns a paginated list of a job’s artifacts.
:param organization: organization slug
:param pipeline: pipeline slug
:param build: build number
:return: Returns a paginated list of a job’s artifacts.
"""
url = self.path + "artifacts/"
return self.client.get(url.format(organization, pipeline, build))
def list_artifacts_for_build(self, organization, pipeline, build, job):
"""
Returns a paginated list of a build’s artifacts across all of its jobs.
:param organization: organization slug
:param pipeline: pipeline slug
:param build: build number
:param job: job id
:return: Returns a paginated list of a build’s artifacts across all of its jobs.
"""
url = self.path + "jobs/{}/artifacts/"
return self.client.get(url.format(organization, pipeline, build, job))

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

Paginated results

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.

New release

It would be great if a new release could be issued, as I'm looking forward to using this improvement 🙏 #82

Filling out the Docstrings

A majority of the docstrings in these classes are not filled out. It would be great to document each class and method.

Flaky test

tests/test_client.py::TestClientRequest can fail when running with pytest --randomly-seed=1234 or pytest --randomly-seed=123.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.