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

Inverted job and build functions for list_artifacts #39

Closed
Sup3rGeo opened this issue Mar 31, 2020 · 1 comment · Fixed by #40
Closed

Inverted job and build functions for list_artifacts #39

Sup3rGeo opened this issue Mar 31, 2020 · 1 comment · Fixed by #40

Comments

@Sup3rGeo
Copy link
Contributor

Sup3rGeo commented Mar 31, 2020

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

@pyasi
Copy link
Owner

pyasi commented Mar 31, 2020

Nice find! And you're correct. Let's get this in (and release alongside your other PR for 0.0.6)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants