Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

coder licenses add CLI command#3632

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spikecurtis merged 5 commits intomainfromspike/3279_add_license_cli
Aug 23, 2022
Merged

Conversation

spikecurtis
Copy link
Contributor

Fixes#3279

Adds a newcoder licenses add subcommand.

Signed-off-by: Spike Curtis <spike@coder.com>
@spikecurtisspikecurtis requested review fromkylecarbs anda teamAugust 22, 2022 22:08
Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Don't worry about the number of comments, there's nothing major in them. This looks good in general. 👍🏻

func TestLicensesAddSuccess(t *testing.T) {
t.Parallel()
// We can't check a real license into the git repo, and can't patch out the keys from here,
// so instead we have to fake the HTTP interaction.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

So that we can test licenses for real (in CI) should we consider adding a secret in GitHub actions and only test it in CI (or when defined locally?).

I'm not sure how it would work, just throwing it out there.

Copy link
ContributorAuthor

@spikecurtisspikecurtisAug 23, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah, if we want to build e2e tests, we'll need real licenses that we don't check into the repo


if filename != "" && license == "" {
var r io.Reader
if filename == "-" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggestion (non-blocking): We could consider defaulting to usingstdin when stdin is not a tty (and no--file or--license), this is a pretty common practice in cli programs.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I picked up-f - fromkubectl, FWIW

Copy link
Member

@mafredrimafredriAug 23, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oh I didn’t mean to insinuate-f - needs to go away, it’s also very unix-y. My suggestion was something of an addition, but feel free to skip.

Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

From our chat earlier today, I worry that by adding the license to the database we introduce a similar problem of consistency, versioning, and general stability in the product.

I think that this can easily be changed though, so I won't prevent this from merging. I'd like if the method to add a license was similar toHashiCorp's route... it seemsreally simple to me.


func licenses() *cobra.Command {
cmd := &cobra.Command{
Short: "Add, remove, and list licenses",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This description doesn't fit what this presently does, so if we did a release this might confuse people.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That's true, but I am working on those, and the converse risk is forgetting to update this

@spikecurtisspikecurtis merged commit184f062 intomainAug 23, 2022
@spikecurtisspikecurtis deleted the spike/3279_add_license_cli branchAugust 23, 2022 20:55
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mafredrimafredrimafredri left review comments

@EmyrkEmyrkEmyrk left review comments

@kylecarbskylecarbskylecarbs approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

POST license file API
4 participants
@spikecurtis@mafredri@Emyrk@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp