Skip to content

643 project variable update #665

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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: 2 additions & 0 deletions gitlab/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def create(self, data, **kwargs):
class UpdateMixin(object):
def _check_missing_update_attrs(self, data):
required, optional = self.get_update_attrs()
# Remove the id field from the required list as it was previously moved to the http path.
required = tuple(filter(lambda k: k != self._obj_cls._id_attr, required))
missing = []
for attr in required:
if attr not in data:
Expand Down
25 changes: 25 additions & 0 deletions tools/cli_test_v4.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,31 @@ testcase "merge request validation" '
--iid "$MR_ID" >/dev/null 2>&1
'

# Test project variables
testcase "create project variable" '
OUTPUT=$(GITLAB -v project-variable create --project-id $PROJECT_ID \
--key junk --value car)
'

testcase "get project variable" '
OUTPUT=$(GITLAB -v project-variable get --project-id $PROJECT_ID \
--key junk)
'

testcase "update project variable" '
OUTPUT=$(GITLAB -v project-variable update --project-id $PROJECT_ID \
--key junk --value bus)
'

testcase "list project variable" '
OUTPUT=$(GITLAB -v project-variable list --project-id $PROJECT_ID)
'

testcase "delete project variable" '
OUTPUT=$(GITLAB -v project-variable delete --project-id $PROJECT_ID \
--key junk)
'

testcase "branch deletion" '
GITLAB project-branch delete --project-id "$PROJECT_ID" \
--name branch1 >/dev/null 2>&1
Expand Down