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

Add login_type to coder_workspace_owner data source #235#287

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
johnstcn merged 11 commits intocoder:mainfrompmareke:main
Sep 11, 2024

Conversation

pmareke
Copy link
Contributor

@pmarekepmareke commentedSep 10, 2024
edited
Loading

This PR add the login type the thecoder_workspace_owner data source (Issue#235).

I took some decisions (like the default value tonone), but if you think this should be different please let me know.

Thanks!

@github-actionsGitHub Actions
Copy link

github-actionsbot commentedSep 10, 2024
edited
Loading

All contributors have signed the CLA ✍️ ✅
Posted by theCLA Assistant Lite bot.

@pmareke
Copy link
ContributorAuthor

I have read the CLA Document and I hereby sign the CLA

@pmarekepmareke changed the titleAdd login_type to coder_workspace_owner data sourceAdd login_type to coder_workspace_owner data source (solves #235)Sep 10, 2024
@pmarekepmareke changed the titleAdd login_type to coder_workspace_owner data source (solves #235)Add login_type to coder_workspace_owner data source #235Sep 10, 2024
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

That was quick! You'll also need to update the integration tests to expect the new field.

pmareke reacted with thumbs up emoji
@pmareke
Copy link
ContributorAuthor

Done!

if login_type := os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"); login_type != "" {
_ = rd.Set("login_type", login_type)
} else {
_ = rd.Set("login_type", "none")
Copy link
Member

Choose a reason for hiding this comment

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

@mtojek should we instead setlogin_type to an empty string if Coder does not set the required env?

pmareke reacted with eyes emoji
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps at the very least, drop adiag.Warn?

Copy link
Member

Choose a reason for hiding this comment

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

should we instead set login_type to an empty string

This seems reasonable and consistent with other ENV vars. I would start with empty string, we can always revisit it in the future and replace it withnone.

pmareke reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This seems reasonable and consistent with other ENV vars. I would start with empty string, we can always revisit it in the future and replace it withnone.

Great, what about the warn?

Copy link
Member

Choose a reason for hiding this comment

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

Adding adiag.Warn if theCODER_WORKSPACE_OWNER_LOGIN_TYPE environment variable is not present or empty would be a good indication to the user that they have a potential mismatch of the Coder version and provider version.

pmareke reacted with thumbs up emoji
Copy link
ContributorAuthor

@pmarekepmarekeSep 11, 2024
edited
Loading

Choose a reason for hiding this comment

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

Sorry, but taking a look to thediag package there is notWarn method.

https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/diag

Copy link
Member

Choose a reason for hiding this comment

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

Sorry! I should have been more specific -- you can append adiag.Diagnostic with severitydiag.Warning to the second return argument of typediag.Diagnostics.

pmareke reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done, this is the first time I have to deal with thediags, so please let me know if this solution is correct 🙏🏼 .

Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

pmareke reacted with heart emoji
if login_type := os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"); login_type != "" {
_ = rd.Set("login_type", login_type)
} else {
_ = rd.Set("login_type", "none")
Copy link
Member

Choose a reason for hiding this comment

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

should we instead set login_type to an empty string

This seems reasonable and consistent with other ENV vars. I would start with empty string, we can always revisit it in the future and replace it withnone.

pmareke reacted with thumbs up emoji
@pmareke
Copy link
ContributorAuthor

All fixed@johnstcn thanks for your time!

Co-authored-by: Cian Johnston <public@cianjohnston.ie>
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

Note that this won't be useful untilcoder/coder is updated to setCODER_WORKSPACE_OWNER_LOGIN_TYPE. This will require a separate PR.

@johnstcnjohnstcn merged commit2598aa7 intocoder:mainSep 11, 2024
8 checks passed
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 11, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@mtojekmtojekAwaiting requested review from mtojek

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

Successfully merging this pull request may close these issues.

3 participants
@pmareke@johnstcn@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp