Commit Graph

113 Commits

Author SHA1 Message Date
Gary Holtz 458033f0da
refactor: Moving test helper functions to their own file for reuse 2024-04-29 23:11:56 -05:00
Oscar Tovar 1f2942d69d Merge branch 'gmh-have-git-tests-actually-use-git' into 'main'
test: have git tests actually use git instead of stubs

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

Merged-by: Oscar Tovar <otovar@gitlab.com>
Approved-by: Erran Carey <ecarey@gitlab.com>
Approved-by: Oscar Tovar <otovar@gitlab.com>
Reviewed-by: Gary Holtz <gholtz@gitlab.com>
Reviewed-by: Oscar Tovar <otovar@gitlab.com>
Reviewed-by: Erran Carey <ecarey@gitlab.com>
Co-authored-by: Gary Holtz <gholtz@gitlab.com>
2024-04-29 21:25:59 +00:00
Gary Holtz 1fa0f55d2f test: have git tests actually use git instead of stubs 2024-04-29 21:25:59 +00:00
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
Gary Holtz 1ef57d61a6 refactor: Moving sanitize function to utilities 2024-04-17 20:43:32 +00:00
Jay McCure d687fefab4
fix(mr create): support non-english languages 2023-10-30 16:20:43 +10:00
Jay McCure 79a9211729 chore(dependency): remove alecthomas/assert module 2023-10-05 13:20:13 +00:00
Jay McCure 849ca1a3ef
fix(auth login): encode scopes for oauth url 2023-09-12 11:24:57 +10:00
Neil Roza 6fcdcccc29 fix: glab ci status needs terminal on stdin 2023-08-29 08:55:16 +00:00
Wesley Schwengle 8d60acdccf fix: Don't add glab-resolved when it already exists in a remote 2023-08-09 15:57:46 +00:00
Michael Mead 4f200f917e feat: add new changelog command 2023-05-17 15:26:35 +00:00
Jay McCure bf9895b8c2 Merge branch 'add-incident-unsubscribe-command' into 'main'
feat(incident): add incident unsubscribe command

Closes #1325

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

Merged-by: Jay McCure <jmccure@gitlab.com>
Approved-by: Halil Coban <hcoban@gitlab.com>
Approved-by: Jay McCure <jmccure@gitlab.com>
Reviewed-by: Tomas Vik (OOO back on 2023-05-10) <tvik@gitlab.com>
Reviewed-by: Vitali Tatarintev <vtatarintev@gitlab.com>
Reviewed-by: Jay McCure <jmccure@gitlab.com>
Co-authored-by: Vitali Tatarintev <vtatarintev@gitlab.com>
2023-05-10 00:32:57 +00:00
Vitali Tatarintev b7f4c3f9ef feat(incident): add incident unsubscribe command
- add `incident unsubscribe` command to unsubscribe from an incident

Delivers: #1325
2023-05-09 09:52:52 +02:00
Igor Drozdov 1dca58075a feat: add command that generates Git commands from natural language 2023-05-04 02:54:41 +00:00
Shekhar Patnaik c9d9138aeb feat(auth login): Add support for OAuth2 2023-05-02 21:25:32 +00:00
Davide Bianchi 7694dfbc6a test: add some test to improve coverage 2023-04-21 22:02:04 +00:00
Vitali Tatarintev b5711554c1 refactor(test): replace os.Setenv with t.Setenv in tests 2023-03-22 17:57:53 +00:00
Vitali Tatarintev 7280737bfc fix(test): use gray256 color in tests when enabled 2023-03-21 01:49:05 +00:00
Vitali Tatarintev f87f7efaa6 fix(color): fix gray color for 256 color terminal 2023-03-20 00:56:43 +00:00
Vitali Tatarintev 453be9169d refactor: use strings.Join in comma separated list functions 2023-02-20 23:46:13 +00:00
Mikel Olasagasti Uranga af24109223 build(deps): update github.com/AlecAivazis/survey/v2 to v2.3.6 2023-01-09 21:21:28 +01:00
Gary Holtz 11c3a9b3c5
fix: used a bracket instead of an escape character 2022-12-06 18:29:59 -06:00
Gary Holtz c795f7e008 fix: Merging security fixes for v1.24.0 release 2022-12-06 19:35:01 +00:00
Kai Armstrong cf0968d56d chore: fix ioutil lint deprecations 2022-11-30 12:45:08 +00:00
Gary Holtz 19893312b9 Merge branch 'iostreams-test-fix-env-var-spelling' into 'main'
fix(iostreams): correct spelling of COLOR_ENABLED env var in color_test

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

Merged-by: Gary Holtz <gholtz@gitlab.com>
Approved-by: Terri Chu <tchu@gitlab.com>
Co-authored-by: Foster Snowhill <2486761-ForstPenguin@users.noreply.gitlab.com>
2022-11-17 21:01:31 +00:00
Foster Snowhill fb325d93c7 fix(iostreams): correct spelling of COLOR_ENABLED env var in color_test 2022-11-17 21:01:31 +00:00
Kai Armstrong 39e9e21313 chore: re-add linting/formatting job to ci 2022-11-17 18:36:09 +00:00
Kai Armstrong b417b30284 chore: fix misspelled words from goreportcard 2022-10-05 15:50:43 -05:00
Oscar Tovar 40a5436789 chore: update module path 2022-09-19 20:23:45 +00:00
Shaun Duncan 795bec9eb5 fix(tests): modify test environment to work correctly for forks 2022-08-10 06:45:31 +00:00
Shaun Duncan b58c1255ed feat(mr): support minimal unified diff output for mr diff
- Modify mr diff output to provide a minimum unified diff support
- Document glab_pager configuration in glab config command
2022-06-20 16:56:32 +00:00
Tomas Vik 343f225203 test: support forks CI in automated tests 2022-06-13 10:47:26 +02:00
Tomas Vik 21025017a9 ci: add unit test task to the CI 2022-06-09 14:29:02 +02:00
zemzale a5f4099291
fix: Don't show non-templates when asking chosing (#927)
* feat(git): Allow for overriding the TopLevelDir

This would allow us to use a different output for this command in tests.

Issue #923

* fix: Don't show non-templates when asking chosing

In cases where users have non template files in the .gitlab/[template]/
folder they might will be picked up and displayed.

This fixes that by filtering out all the files that are hidden and don't
end in .md

Issue #923

* feat(cmdutils): Sort templates in alphabetical order
2022-01-31 18:20:22 +00:00
LitoMore 882611d958
Fix hyperlinks rendering in less (#936)
* Fix hyperlinks rendering in less

* Fix multi-append

* Fix logic of less env
2022-01-19 01:20: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 dd0900c516 --amend 2021-08-01 05:17:29 +00:00
Gabriel Mazetto bf21da159e Allow rendering Markdown without indentations 2021-07-01 02:48:31 +02:00
Clement Sam f7a73422e4 feat: add `release download` command 2021-05-27 12:53:18 +00:00
Clement Sam 6ab86717a5 fix markdown renderer color 2021-05-25 01:22:31 +00:00
Clement Sam af5ba63dc6 interactive options and better error handling 2021-05-23 02:51:23 +00:00
Clement Sam c707d7d3f7 feat: add `release create` command 2021-05-22 02:58:29 +00:00
Clement Sam 2fc5856d22 ci status: improve scriptability
Ensures user is not prompted on non-ttys with options to retry or view logs
2021-05-12 01:08:22 +00:00
Clement Sam e5cf7c3143 scriptability: Avoid truncating columns of tables/lists on non-TTYs
This is a hot fix to solve where glab still truncates lines with length longer that the specified column width on non-TTYs to improve scriptability

Resolves #706
2021-05-12 00:43:54 +00:00
Clement Sam 4076dd77c0 feat: mr merge options
This adds merge options when merging an MR. The user is given three merge options
- create merge commit
- squash and merge
- rebase and merge

NB: This options are only available on TTYs. On non-ttys, the default is to create a merge commit unless the user explicitly specifies the merge method using the available flag options
2021-04-29 20:08:04 +00:00
Alberts Zemzale be467fac9a fix(utils): Resolve bgColor before pager starts
So far we have started the pager and then got background color glamour
style from enviorment.

If enviorment value is not set it defaults to auto. Which in turn uses
termenv to resolve background color using some terminal escape code
sequences. The problem with this is that doing this when a pager like
less is running, just doesn't work and leaves less in a broken state.

To fix this we are now checking the background color manually and before
we start the pager.

Issue #636
2021-03-11 14:25:58 +02:00
Clement Sam 961b8a3c3a Override survey's choice of color for default values
For default values for e.g.  prompts, Survey uses the literal white color, which makes no sense on dark terminals and is literally invisible on light backgrounds.

This overrides Survey to output a gray color for 256-color terminals and default for basic terminals.
2021-03-10 21:20:43 +00:00