Commit Graph

201 Commits

Author SHA1 Message Date
Viacheslav Vasilyev d4663189c2 feat: allow to provide custom client-id 2024-04-24 19:27:12 +00:00
Gary Holtz a09c60159e
test: fix issue with environment variables being set 2024-04-20 16:19:20 -05:00
Justen Stall 6d181a1f0b
fix(deps): update github.com/xanzy/go-gitlab to v0.101.0
- Update github.com/xanzy/go-gitlab from v0.93.0 to v0.101.0
- Update rebase MR functions to use RebaseMergeRequestOptions for setting the "skip_ci" field
- Update all request options to use the LabelOptions type
- Replace deprecated gitlab.{String,Int,Bool,etc} functions with gitlab.Ptr

Fixes #7504

Signed-off-by: Justen Stall <justenstall@gmail.com>
2024-04-04 14:24:13 -04:00
Mikel 49f06b73a1 chore(dependency): update to github.com/google/renameio/v2 2024-01-09 15:52:48 +00:00
Mikel eb8c3fa7c5 chore: remove deprecated `config init` command 2023-12-14 17:51:26 +00:00
Jay McCure 79a9211729 chore(dependency): remove alecthomas/assert module 2023-10-05 13:20:13 +00:00
Eli Treuherz 43f6e60bd3 fix: Handle trailing slash in remote URL 2023-08-01 03:00:08 +00:00
Jay McCure 8d45b94ca5
fix(repo view): consider current host when viewing a repo details 2023-06-27 11:23:40 +10:00
Jay McCure 8759c09eab feat: better error messages for no matching remotes 2023-05-19 07:45:45 +00:00
Jay McCure 6d0d85511d
chore: stop overwriting config file in test 2023-05-10 17:58:33 +10:00
Clement Sam 85416db280 refactor: autogenerate config stub from lockfile 2023-04-27 14:29:22 +00:00
Waldemar Quevedo 2ad363a321 docs: update godoc for function 2023-04-21 21:24:45 +00:00
Gary Holtz 55079f798d Merge branch 'feat-keyring-support' into 'main'
feat: add support for token storage in encrypted keyrings

Closes #957

See merge request https://gitlab.com/gitlab-org/cli/-/merge_requests/1227

Merged-by: Gary Holtz <gholtz@gitlab.com>
Approved-by: Amy Qualls <aqualls@gitlab.com>
Approved-by: Gary Holtz <gholtz@gitlab.com>
Reviewed-by: Gary Holtz <gholtz@gitlab.com>
Reviewed-by: Shekhar Patnaik <spatnaik@gitlab.com>
Co-authored-by: Marek Vospěl <marek@vospel.cz>
Co-authored-by: Shekhar Patnaik <spatnaik@gitlab.com>
Co-authored-by: Amy Qualls <aqualls@gitlab.com>
2023-04-13 21:25:22 +00:00
Marek Vospěl 029ecd1872
test: fix Test_getFromKeyring not passing in CI 2023-04-12 21:29:29 +02:00
Marek Vospěl c46ec24b53
test: fix assertion order, clear token in keyring test 2023-04-12 20:24:02 +02:00
Kai Armstrong bd1c3b937d
refactor: default check_update true on new install 2023-04-11 13:10:50 -05:00
Marek Vospěl 85772c02a7
test: add tests for loading and storing tokens in keyring 2023-04-10 23:56:07 +02:00
Marek Vospěl 2cf061189a
chore: update docs, fix lint error 2023-04-10 23:56:07 +02:00
Marek Vospěl c5f06fd679
feat: add support for token storage in encrypted keychains 2023-04-10 13:35:38 +02:00
Vitali Tatarintev b5711554c1 refactor(test): replace os.Setenv with t.Setenv in tests 2023-03-22 17:57:53 +00:00
Gary Holtz d736ef7837 Merge security fix for v1.26.0 release 2023-03-10 19:00:54 +00:00
Jaime Martinez 64d1477946 feat: add recover option to issue create command 2022-12-06 06:31:33 +00:00
Kai Armstrong cf0968d56d chore: fix ioutil lint deprecations 2022-11-30 12:45:08 +00:00
Kai Armstrong 39e9e21313 chore: re-add linting/formatting job to ci 2022-11-17 18:36:09 +00:00
James Liu 5e00cdf125 fix: Read hostname from config.yml 2022-11-07 20:52:56 +00:00
Kai Armstrong b417b30284 chore: fix misspelled words from goreportcard 2022-10-05 15:50:43 -05:00
Gary Holtz b239ec1e80 Merge branch 'gmh-fix-editor-tests' into 'main'
Fix tests involving $EDITOR variable

See merge request https://gitlab.com/gitlab-org/cli/-/merge_requests/1019

Merged-by: Gary Holtz <gholtz@gitlab.com>
Approved-by: Jason Crown <jcrown@gitlab.com>
2022-09-23 17:28:18 +00:00
Gary Holtz 66a864bb97 Fix tests involving $EDITOR variable 2022-09-23 17:28:18 +00:00
Oscar Tovar 40a5436789 chore: update module path 2022-09-19 20:23:45 +00:00
Clement Sam 40c8f6760e fix(check-update): check latest release from GitLab
Currently the check-update command which checks for
latest glab releases, checks from the releases page
of the old GitHub repo.

This MR changes this behaviour to check releases
from the new gitlab-org/cli repo.
2022-08-10 18:58:23 +00:00
Calle Pettersson 3c2b1e7399
fix: Fail with a specific error when unauthenticated (#886)
* fix: Fail with a specific error when unauthenticated

If resolutions fails, return the error instead of "no GitLab Projects found
from remotes"

* fix: Do not break multi-network setups on authentication failure

* go mod tidy
2022-02-28 15:20:55 +00:00
JM e018da7a8e
accept GITLAB_ACCESS_TOKEN (#940) 2022-01-17 15:48:08 +00:00
zemzale 8a98e38ce9
fix: Write aliases to symlink if it exists (#930)
In cases where `aliases.yaml` was smylinked to some other place(dotfiles
for example), it would remove the smylink and write to a new file.

This commit fixes that by resolving the smylink before writing to the
file.

Issue #892
2021-12-20 17:44:32 +00:00
Christian Kampka e866496799
feature: Read config directory from GLAB_CONFIG_DIR (#921)
When working with many different gitlab instances for different
projects, the global config quickly gets cluttered up with
specific settings that do not clean up conveniently. On the other hand,
local configs are to local, restricting the config to one repository
instead of one project or instance that potentially contains many
relevant repositories.
This change introduces a middle ground solution via the GLAB_CONFIG_DIR
environment variable. Setting this variable will allow global
configuration to travel with the project instead of populating the XDG
global config.
2021-12-02 16:49:14 +00:00
Rob Hoelz 2eba4de79a
Add support for terminal hyperlinks (#852)
* feat: Add ground work for supporting hyperlinks to iostreams

See GH #812

See https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
for technical details behind the hyperlink escape sequence

For now hyperlinks are enabled as long as long as standard output is a
TTY - we'll want to add some additional detection/flags down the road

* feat: use terminal hyperlinks when listing issues/MRs

See GH #812

* feat(hyperlinks): Add display_hyperlinks config option

* chore(hyperlinks): Clean up Hyperlink API a bit

* feat(hyperlinks): default hyperlinks to off

I think hyperlink display should default to off while the feature is new
so that users can play with it

* feat(hyperlinks): Implement FORCE_HYPERLINKS

Setting the FORCE_HYPERLINKS environment variable forces glab to render
hyperlinks when it can - otherwise, it falls back to display_hyperlinks
from the config, which tells glab whether or not to enable hyperlinks
based on whether or not we're outputting to a TTY.

* fix(hyperlink): accommodate hyperlink OSC in string stripping

* fix: Fix incorrect web_url in fixture data

* test(hyperlink): Add tests for hyperlinks in issues list

* test(hyperlink): Add tests for truncating text with hyperlink OSC

* fix(hyperlinks): accommodate hyperlinks in Truncate

* test(hyperlinks): Add tests for showing hyperlinks in mr list

* docs(hyperlink): Add docs for FORCE_HYPERLINKS and display_hyperlinks

* fix(hyperlinks): simplify truncate algorithm

…while also fixing tableprinter tests, which expect that the first
grapheme provided to Truncate is always preserved

* fix(hyperlinks): Deactivate hyperlinks in auto mode if we're writing to a pager
2021-10-27 09:41:35 +00:00
pataar e76db5969c ci: fix the linter by targeting the pull request instead of the target 2021-10-04 19:41:53 +02:00
addshore b8928008b5 Move glinstance to pkg 2021-09-24 18:51:08 +01:00
Clement Sam a9ec9d7045 internal/config: migrate local config to `.git/glab-cli`
To set a local config, glab writes to .glab-cli/config/config.yaml and
to hide it, writes to .gitignore.
This change migrates the local config to .git/glab-cli to avoid messing with the .gitignore of the current project.
2021-08-10 03:56:35 +00:00
Clement Sam b0d51cd162 auth/login: fix broken link to personal_access_token 2021-07-04 22:45:54 +00:00
Clement Sam e4cb0f047e add support for full urls
Adding support for allowing users enter full URLs to project path.
This will allows users override the repo host and protocol.

Examples:
- glab repo view git@gitlab.com:profclems/glab.git
- glab repo view https://gitlab.company.org/user/repo
- glab repo view https://gitlab.company.org/user/repo.git
2021-07-04 04:33:11 +00:00
Clement Sam af5ba63dc6 interactive options and better error handling 2021-05-23 02:51:23 +00:00
Clement Sam 65a7d410e5 fix auth status tests 2021-05-14 05:59:42 +00:00
Clement Sam effb472631 depend on git credentials for pull/push/clone commands
We don't need to use user credentials for pull/push/clone operations since the user can now opt to saving credentials to git-credential helper else, be prompted to login each time
2021-05-12 19:38:17 +00:00
Clement Sam dec8dabdb9 feat: git-credential store hack 2021-05-12 19:38:04 +00:00
Alberts Zemzale e4456570e2 fix(glrepo): Remove side effect form RemoteURL
RemoteURL was changing one if it's passed in variables. This introduced
problems with subsequent calls to the function, because member
`RemoteArgs.Protocol` was changed to from `https` to `https://`. This
made every other call to the function skip over the protocol and just
return ssh URL.

Issue #710
2021-05-11 20:42:33 +03:00
Clement Sam 70ea685827 Allow protocol override when overriding the default host
This allows overriding the default protocol of the hostname if a fully qualified url is provided when using the `GITLAB_HOST` environment variable.
For example, if the GITLAB_HOST=http://my.glinstance.org, then the host will be set to my.glinstance.org and the protocol become http, unlike before when the protocol was ignored and only the hostname was considered.

This is a follow-up for #678
and #667
2021-04-30 06:42:11 +00:00
Thorsten Schifferdecker ae12f30834
fix: correct simple typo
Signed-off-by: Thorsten Schifferdecker <schifferdecker@b1-systems.de>
2021-03-06 03:01:27 +01:00
Clement Sam dbfdad36e4 fix: support deep nested subgroups in repo path
`glab` initially only suppported repo paths in the format HOST/OWNER/REPO and HOST/GROUP/NAMESPACE/REPO.
Knowing that GitLab supports deep nested subgroups, this adds supports for deep nested
groups.

Resolves #609
2021-02-13 21:10:41 +00:00
Lars Gohlke 7e46d6b859 fix config test 3 2021-01-30 22:42:40 +01:00
Lars Gohlke c7a1d1a4b4 fix order 2021-01-30 22:40:01 +01:00