Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Clement Sam
@profclems
Sure... I get it
Benjamin Graf
@bgraf
Will be an opportunity for me to see, how easy/difficult it is to understand a larger go code base, looking forward to it
Clement Sam
@profclems
🎉
Notify in case you need any clarification
I'm currently writing tests for the commands
Benjamin Graf
@bgraf
Yes, what's your thought on how to cache the labels. Should I config.SetEnv them in the listLabels command if UseGlobalConfig == false and otherwise don't? Then in the prompt I GetEnv and if it is empty, we prompt like before, and if there are options, we use multi select?
Clement Sam
@profclems
Yeah sounds good. But the values passed to config.SetEnv should be comma-separated label names since it will be much easier to split into a map and use for the prompt. I would suggest PROJECT_LABELS as the env name.
Benjamin Graf
@bgraf
@profclems I've already chosen "PROJECT_LABELS", good match :)
Clement Sam
@profclems
Haha... great
Benjamin Graf
@bgraf
@profclems I submitted a pull-request for further discussion
Clement Sam
@profclems
Yeah... I'm taking a look
Clement Sam
@profclems

How to deal with new labels when prompting via multi select?

This is worth considering...

There should be a better workaround to handle this 🤔
Benjamin Graf
@bgraf
well, maybe it would be sufficient to say that users need to use the -l options to do that then? I guess the number of times you want to add an existing label largely outnumbers the times you'd want to add a new one?
another option is to have multiple steps, i.e.: first the multiselect, then the old prompt to "add" more labels to it.. hm
Clement Sam
@profclems

well, maybe it would be sufficient to say that users need to use the -l options to do that then? I guess the number of times you want to add an existing label largely outnumbers the times you'd want to add a new one?

Yeah the multistep seems fine but the user should ask for it using a flag. I think the -l should be fine

Clement Sam
@profclems
Thinking about it again, we should go with your first suggestion instead of the multistep
Benjamin Graf
@bgraf
Yes, ok
Benjamin Graf
@bgraf
@profclems how can I retrofit signatures onto my commits, should I rebase&squash them and sign the resulting single commit, then force push my branch on my repository? do you have experience with that case? sorry to have forgotten that requirement :)
Benjamin Graf
@bgraf
ok, that worked out, all commits signed
Clement Sam
@profclems
Ok nice
nlarzon
@nlarzon
Hi, is there anyway I can configure glab to use specific certificates for api calls?
Clement Sam
@profclems
Yes. You can do that in your config file by adding the path to the ca cert using the ca_cert config value.
You can also set with
glab config set ca_cert "/path/to/cert"
nlarzon
@nlarzon
thx
Clement Sam
@profclems
You can also make it host specific
glab config set ca_cert "/path/to/cert" --host gitlab.example.org
nlarzon
@nlarzon
" none of the git remotes configured for this repository points to a known GitLab host. Please use glab config init to configure a new host for glab" Is there a debug command I can use?
Clement Sam
@profclems
You should run glab auth login to authenticate with your GitLab instance
nlarzon
@nlarzon
yes, done that. Still the same issue
Clement Sam
@profclems
Run git remotes -v to see if your repo contains the host you have authenticated with glab.
glab checks to see if the repository points to an authenticated host and uses it
nlarzon
@nlarzon
yes it does
nlarzon
@nlarzon
    gitlab.mydomain.com:
        api_protocol: https
        token: <super-secret>
        git_protocol: ssh
        user: me
        ca_cert: path/client.pem
        ca_cert_key: path/client-key.pem
remote_alias: origin


git remote -v
origin    git@gitlab.mydomain.com:my-group/project/repo.git (fetch)
Clement Sam
@profclems
There's a host mismatch here. You're using gitlab.mydomain.com in glab's config but your host is git.mydomain.com
Update the host in your config to git.mydomain.com
nlarzon
@nlarzon
sorry it is just my anonymization that is wrong
Clement Sam
@profclems
I can't seem to reproduce the error
I'm thinking you should still check. There's probably a host mismatch
Clement Sam
@profclems
@nlarzon kindly open an issue on it if you're still facing this issue
maxice8
@maxice8_gitlab
@profclems yes ?
maxice8
@maxice8_gitlab
What is the blessed way to stub a prompt function so it returns a specified value ? so I can test PickMetadata()
Clement Sam
@profclems

The functions in the prompt package have stub functions for test. Take a look at the mr_create_test where I stubbed the submit confirmation prompt with:

ask, teardown := prompt.InitAskStubber()
    defer teardown()

    ask.Stub([]*prompt.QuestionStub{
        {
            Name:  "confirmation",
            Value: 0,
        },
    })

This selects the first option which is submit

maxice8
@maxice8_gitlab
Hmm, I don't seem to be able to stub a prompt.MultiSelect
Clement Sam
@profclems
I opened a PR to make it easier to stub multiselect #480
Check the comment here: https://github.com/profclems/glab/pull/480#issuecomment-753327499
maxice8
@maxice8_gitlab
Thanks
maxice8
@maxice8_gitlab
resolveNetwork() was a fun function to look at
Clement Sam
@profclems
@maxice8_gitlab I took a closer look at agl and you had some long term plans for it. I took 2 of them which I think we can bring into glab:
  1. Provide TUI to comment on issues
  2. dissect GitLab to allow creating personal access token from the commandline
maxice8
@maxice8_gitlab
I see, the second one would be the best.
kaddkaka
@kaddkaka
Hi :) I just found this tool after getting TOOO annoyed that gitlab webgui is so extremely slow.
What is the current state of glab mr view? it seems to be missing basic stuff
zemzale
@zemzale
Hey. What do you exactly mean by missing basic stuff?
kaddkaka
@kaddkaka
Well probably I just dont know where to look. But when listing comments, is there any way to see the context to which the comment refer?