Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GitLab API Experiments
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Karl Fogel
GitLab API Experiments
Commits
31126a82
Commit
31126a82
authored
4 months ago
by
Karl Fogel
Browse files
Options
Downloads
Patches
Plain Diff
Document upcoming features
parent
7ed9ef1c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gl-sak
+37
-2
37 additions, 2 deletions
gl-sak
with
37 additions
and
2 deletions
gl-sak
+
37
−
2
View file @
31126a82
...
...
@@ -4,6 +4,36 @@
A general-purpose GitLab tool for batch access to and manipulation of
entities (issues, labels, milestones, etc) in a GitLab project.
Usage
$ ./gl-sak --root OWNER[/PROJECT_PATH] COMMAND [ARGS...]
OWNER/PROJECT_PATH is something like
"
jrandom/foo/bar/myproj
"
.
TBD: Document some commands, some of which take further arguments.
GitLab authentication and authorization
---------------------------------------
Each time you run this script, you will be prompted for a GitLab
authorization token. If you don
'
t want to be prompted, put the token
as the first line of a file (you might want to restrict that file
'
s
permissions so that only you can read it) and pass the file with the
'
--authn-token-file
'
option, like so:
$ ./gl-sak --authn-token-file FILE_CONTAINING_TOKEN [...]
You could also pass the token directly via the command line with the
'
--auth-token
'
option, like this:
$ ./gl-sak --authn-token TOKEN [...]
However, be careful about that: the token could then leak via
'
ps
'
listings, shell history, etc. Only you can decide whether using
'
--authn-token
'
is a reasonable choice given the security properties
of your runtime environment, but if you are in any doubt, just use
'
--authn-token-file
'
instead.
"""
# To get started:
...
...
@@ -29,13 +59,18 @@ def main():
# here would be RawDescriptionHelpFormatter.
formatter_class
=
argparse
.
RawTextHelpFormatter
)
arg_parser
.
add_argument
(
'
-t
'
,
'
--access-token
'
,
'
-T
'
,
'
--authn-token
'
,
# TBD: This next one is not implemented yet. Also, how to
# tell argparse that two options are mutually incompatible?
# Do we just have to do that with post-parsing code, or does
# argparse have a built-in way to handle it?
'
-F
'
,
'
--authn-token-file
'
,
help
=
"
The GitLab access token to use for this operation
"
)
args
=
arg_parser
.
parse_args
()
# Set up the GitLab instance.
lhq
=
gitlab
.
Gitlab
(
url
=
'
https://code.librehq.com
'
,
private_token
=
args
.
a
ccess
_token
)
private_token
=
args
.
a
uthn
_token
)
lhq
.
auth
()
# WARNING: Turning on debugging can cause credentials and other
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment