-
Notifications
You must be signed in to change notification settings - Fork 4k
[REMOTE-1370] Phase 2a: taskGitCredentials schema, query, and AIClient #10152
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| use crate::{error::UserFacingError, request_context::RequestContext, schema}; | ||
|
|
||
| /// A GraphQL query to fetch git credentials for a specific task. | ||
| /// | ||
| /// This query is used by Agent Mode tasks to retrieve a fresh GitHub token that the | ||
| /// driver uses to configure git and the gh CLI, and to refresh those credentials | ||
| /// periodically so long-running agents retain GitHub access for their full duration. | ||
| #[derive(cynic::QueryFragment, Debug)] | ||
| #[cynic(graphql_type = "RootQuery", variables = "TaskGitCredentialsVariables")] | ||
| pub struct TaskGitCredentials { | ||
| #[arguments(input: $input, requestContext: $request_context)] | ||
| pub task_git_credentials: TaskGitCredentialsResult, | ||
| } | ||
|
|
||
| crate::client::define_operation! { | ||
| task_git_credentials(TaskGitCredentialsVariables) -> TaskGitCredentials; | ||
| } | ||
|
|
||
| #[derive(cynic::QueryVariables, Debug)] | ||
| pub struct TaskGitCredentialsVariables { | ||
| pub input: TaskGitCredentialsInput, | ||
| pub request_context: RequestContext, | ||
| } | ||
|
|
||
| #[derive(cynic::InputObject, Debug)] | ||
| pub struct TaskGitCredentialsInput { | ||
| pub task_id: cynic::Id, | ||
| pub workload_token: String, | ||
| } | ||
|
|
||
| #[derive(cynic::InlineFragments, Debug)] | ||
| pub enum TaskGitCredentialsResult { | ||
| TaskGitCredentialsOutput(TaskGitCredentialsOutput), | ||
| UserFacingError(UserFacingError), | ||
| #[cynic(fallback)] | ||
| Unknown, | ||
| } | ||
|
|
||
| #[derive(cynic::QueryFragment, Debug)] | ||
| pub struct TaskGitCredentialsOutput { | ||
| pub credentials: Vec<TaskGitCredential>, | ||
| } | ||
|
|
||
| #[derive(cynic::QueryFragment, Debug)] | ||
| pub struct TaskGitCredential { | ||
| pub token: String, | ||
| pub username: Option<String>, | ||
| pub email: Option<String>, | ||
| pub host: String, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.