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

chore: bring commit signatures up to date with 12.10#1082

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
max-wittig merged 2 commits intomasterfromchore/signature-gpg-x509
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletiondocs/cli.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -258,7 +258,7 @@ Get a specific project commit by its SHA id:

$ gitlab project-commit get --project-id 2 --id a43290c

Get the GPGsignature of a signed commit:
Get thesignature (e.g.GPGor x509) of a signed commit:

.. code-block:: console

Expand Down
2 changes: 1 addition & 1 deletiondocs/gl_objects/commits.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -82,7 +82,7 @@ Get the references the commit has been pushed to (branches and tags)::
commit.refs('tag') # only tags
commit.refs('branch') # only branches

Get theGPGsignature of the commit (if the commit was signed)::
Get the signature of the commit (if the commit was signed, e.g. with GPG or x509)::

commit.signature()

Expand Down
4 changes: 2 additions & 2 deletionsgitlab/v4/objects.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2299,7 +2299,7 @@ def revert(self, branch, **kwargs):
@cli.register_custom_action("ProjectCommit")
@exc.on_http_error(exc.GitlabGetError)
def signature(self, **kwargs):
"""Get theGPGsignature of the commit.
"""Get the signature of the commit.

Args:
**kwargs: Extra options to send to the server (e.g. sudo)
Expand All@@ -2309,7 +2309,7 @@ def signature(self, **kwargs):
GitlabGetError: If the signature could not be retrieved

Returns:
dict: The commit'sGPGsignature data
dict: The commit's signature data
"""
path = "%s/%s/signature" % (self.manager.path, self.get_id())
return self.manager.gitlab.http_get(path, **kwargs)
Expand Down
21 changes: 8 additions & 13 deletionstools/cli_test_v4.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -113,11 +113,11 @@ testcase "revert commit" '
--id "$COMMIT_ID" --branch master
'

# Test commitGPGsignature
testcase "attempt to getGPGsignature of unsigned commit" '
# Test commit signature
testcase "attempt to get signature of unsigned commit" '
OUTPUT=$(GITLAB project-commit signature --project-id "$PROJECT_ID" \
--id "$COMMIT_ID" 2>&1 || exit 0)
echo "$OUTPUT" | grep -q "404GPGSignature Not Found"
echo "$OUTPUT" | grep -q "404 Signature Not Found"
'

# Test project labels
Expand DownExpand Up@@ -218,23 +218,18 @@ testcase "values from files" '
CREATE_PROJECT_DEPLOY_TOKEN_OUTPUT=$(GITLAB -v project-deploy-token create --project-id $PROJECT_ID \
--name foo --username root --expires-at "2021-09-09" --scopes "read_registry")
CREATED_DEPLOY_TOKEN_ID=$(echo "$CREATE_PROJECT_DEPLOY_TOKEN_OUTPUT" | grep ^id: | cut -d" " -f2)
testcase "create project deploy token" '
testcase "create project deploy token (name)" '
echo $CREATE_PROJECT_DEPLOY_TOKEN_OUTPUT | grep -q "name: foo"
'
testcase "create project deploy token" '
testcase "create project deploy token (expires-at)" '
echo $CREATE_PROJECT_DEPLOY_TOKEN_OUTPUT | grep -q "expires-at: 2021-09-09T00:00:00.000Z"
'
testcase "create project deploy token" '
testcase "create project deploy token (scopes)" '
echo $CREATE_PROJECT_DEPLOY_TOKEN_OUTPUT | grep "scopes: " | grep -q "read_registry"
'
# Uncomment once https://gitlab.com/gitlab-org/gitlab/-/issues/211963 is fixed
#testcase "create project deploy token" '
# echo $CREATE_PROJECT_DEPLOY_TOKEN_OUTPUT | grep -q "username: root"
#'

# Remove once https://gitlab.com/gitlab-org/gitlab/-/issues/211963 is fixed
testcase "create project deploy token" '
echo $CREATE_PROJECT_DEPLOY_TOKEN_OUTPUT | grep -q "gitlab+deploy-token"
testcase "create project deploy token (username)" '
echo $CREATE_PROJECT_DEPLOY_TOKEN_OUTPUT | grep -q "username: root"
'

LIST_DEPLOY_TOKEN_OUTPUT=$(GITLAB -v deploy-token list)
Expand Down
4 changes: 2 additions & 2 deletionstools/python_test_v4.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -500,13 +500,13 @@
# assert commit.refs()
# assert commit.merge_requests()

# commitGPGsignature (for unsigned commits)
# commit signature (for unsigned commits)
# TODO: reasonable tests for signed commits?
try:
signature = commit.signature()
except gitlab.GitlabGetError as e:
error_message = e.error_message
assert error_message == "404GPGSignature Not Found"
assert error_message == "404 Signature Not Found"

# commit comment
commit.comments.create({"note": "This is a commit comment"})
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp