-
Notifications
You must be signed in to change notification settings - Fork 888
feat: pass access_token
to coder_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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d1ecc81
to
08e9d55
Compare
UserID: owner.ID, | ||
}) | ||
if errors.Is(err, sql.ErrNoRows) { | ||
continue |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
} | ||
// We weren't able to find a matching config for the ID! | ||
if config == nil { | ||
continue |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
repeated provisioner.VariableValue variable_values = 5; | ||
provisioner.Provision.Metadata metadata = 6; | ||
bytes state = 7; | ||
repeated provisioner.GitAuthProvider git_auth_providers = 6; |
There was a problem hiding this comment.
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 perform custom actions, like clone repositories.
08e9d55
to
54466ce
Compare
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: