Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support setting commit status#82

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpocentek merged 1 commit intopython-gitlab:masterfromcdbennett:commitstatus
Jan 13, 2016

Conversation

cdbennett
Copy link

Support commit status updates. Commit status can be set by a POST to
the appropriate commit URL. The status can be updated by a subsequent
POST to the same URL with the samename andref, but different
values forstate,description, etc.

@@ -787,6 +802,7 @@ class Project(GitlabObject):
managers = [
('branches', ProjectBranchManager, [('project_id', 'id')]),
('commits', ProjectCommitManager, [('project_id', 'id')]),
('statuses', ProjectCommitStatusManager, [('project_id', 'id')]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

For consistency I'd call the attribute 'commitstatuses' instead of 'statuses' (to match the class name).

@gpocentek
Copy link
Contributor

Looks good, but could you address my comments? Thanks!

@cdbennett
Copy link
Author

Sure, thanks for the review and suggestions. I update based on your recommendations.

Support commit status updates.  Commit status can be set by a POST tothe appropriate commit URL.  The status can be updated by a subsequentPOST to the same URL with the same `name` and `ref`, but differentvalues for `state`, `description`, etc.Note: Listing the commit statuses is not yet supported.  This is donethrough a different path on the server, under the `repository` path.Example of use from the CLI:    # add a build status to a commit    gitlab project-commit-status create --project-id 2 \        --commit-id a43290c --state success --name ci/jenkins \        --target-url http://server/build/123 \        --description "Jenkins build succeeded"
@cdbennett
Copy link
Author

OK, I addressed your comments by doing the following and rebased the topic branch fresh on master:

  1. Rename attribute to commitstatuses
  2. Add blank line per PEP8
  3. Remove deprecated function that was being added to Gitlab class
  4. And also: Remove usage example from the deletedREADME.md file

The usage example seems helpful to give a quick summary of the expectations of the multiple GitLab attributes for this operation:

gitlab project-commit-status create --project-id 2 --commit-id a43290c \    --state success --name ci/jenkins --target-url http://server/build/123 \    --description "Jenkins build succeeded"

And the docstring that was in the Gitlab class function was a useful quick reference:

    This is often used for automated software build or test status.    Args:        id: Commit reference.        kwargs: Arbitrary keyword arguments for the status:            Required:            - state: pending, running, success, failed, canceled            Optional:            - description: short description of this status            - name:        label for this status e.g., name=ci/jenkins            - ref:         branch reference e.g., ref=master            - target_url:  hyperlink target for this status

At some point it would be nice to add this kind of info to the docs for the project-commit-status creation operation.

gpocentek pushed a commit that referenced this pull requestJan 13, 2016
@gpocentekgpocentek merged commit02c5398 intopython-gitlab:masterJan 13, 2016
@gpocentek
Copy link
Contributor

Thanks for the patch. I'll add the documentation bits

@cdbennettcdbennett deleted the commitstatus branchFebruary 5, 2016 22:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@cdbennett@gpocentek

[8]ページ先頭

©2009-2025 Movatter.jp