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

feat: passaccess_token tocoder_git_auth resource#6713

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
kylecarbs merged 1 commit intomainfromaccessgitauth
Mar 22, 2023

Conversation

kylecarbs
Copy link
Member

@kylecarbskylecarbs commentedMar 21, 2023
edited
Loading

This allows template authors to leverage git auth to perform custom actions, like clone repositories.

I mostly moved code around in this, there are actually very few changes. The increased lines is primarily due to hardening around refreshing the Git token, which I felt was important enough to become slightly abstracted.

This essentially enables:

data"coder_git_auth""github" {id="github"}resource"coder_agent""dev" {env={    GITHUB_TOKEN: data.coder_git_auth.github.access_token,  }}

@kylecarbskylecarbs requested a review fromsreyaMarch 21, 2023 22:17
@kylecarbskylecarbs self-assigned thisMar 21, 2023
@kylecarbskylecarbsforce-pushed theaccessgitauth branch 2 times, most recently fromd1ecc81 to08e9d55CompareMarch 21, 2023 22:56
UserID: owner.ID,
})
if errors.Is(err, sql.ErrNoRows) {
continue
Copy link
Member

Choose a reason for hiding this comment

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

I assumed that git auth was required if a template specifies it based on not being able to create a workspace in dogfood until I set it up. Should this not fail the build early or something?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think we might make this an option in the data source eventually, but the default should be to never fail builds.

This feature is mostly useful for a first-time clone anyways.

deansheather reacted with thumbs up emoji
}
// We weren't able to find a matching config for the ID!
if config == nil {
continue
Copy link
Member

Choose a reason for hiding this comment

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

We should probably log and/or fail the build here.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

True, I'll make it warn.

Comment on lines 19 to 20
repeated provisioner.VariableValue variable_values = 5;
provisioner.Provision.Metadata metadata = 6;
bytes state = 7;
repeated provisioner.GitAuthProvider git_auth_providers = 6;
Copy link
Member

Choose a reason for hiding this comment

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

these two lines have tabs instead of 8 spaces

This allows template authors to leverage git auth to performcustom actions, like clone repositories.
@kylecarbskylecarbsenabled auto-merge (squash)March 22, 2023 19:14
@kylecarbskylecarbs merged commitdf31636 intomainMar 22, 2023
@kylecarbskylecarbs deleted the accessgitauth branchMarch 22, 2023 19:37
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 22, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@deansheatherdeansheatherdeansheather approved these changes

@sreyasreyaAwaiting requested review from sreya

Assignees

@kylecarbskylecarbs

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@kylecarbs@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp