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

refactor(agent/agentssh): move envs to agent and add agentssh config struct#12204

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
mafredri merged 9 commits intomainfrommafredri/refactor-agentssh-config
Feb 19, 2024

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedFeb 19, 2024
edited
Loading

This PR refactors where custom environment variables are set in the workspace and decouplesagent specific configs from theagentssh.Server. To reproduce all functionality,agentssh.Config is introduced.

The custom environment variables are now configured inagent/agent.go and the agent retains control of the final state. This will allow for easier extension in the future and keep other modules decoupled.

Related#11131 (follow-up PR).

@mafredrimafredri self-assigned thisFeb 19, 2024
@@ -278,8 +278,13 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
subsystems = append(subsystems, subsystem)
}

procTicker := time.NewTicker(time.Second)
defer procTicker.Stop()
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Review: This is unused.

mtojek reacted with thumbs up emoji
environmentVariables := map[string]string{
"GIT_ASKPASS": executablePath,
}
if v, ok := os.LookupEnv(agent.EnvProcPrioMgmt); ok {
Copy link
MemberAuthor

@mafredrimafredriFeb 19, 2024
edited
Loading

Choose a reason for hiding this comment

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

Review: This was dirtying all workspaces with an empty env, even when not set.

johnstcn reacted with thumbs up emoji
"CODER": "true", // From the agent.
"MY_MANIFEST": "true", // From the manifest.
"MY_OVERRIDE": "true", // From the agent environment variables option, overrides manifest.
"MY_SESSION_MANIFEST": "false", // From the manifest, overrides session env.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Review: This is not necessarily correct behavior (IMO), but I wanted to stay truthful to the existing implementation.

environmentVariables := map[string]string{
"GIT_ASKPASS": executablePath,
}
if v, ok := os.LookupEnv(agent.EnvProcPrioMgmt); ok {
Copy link
Member

Choose a reason for hiding this comment

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

I see that thisos.LookupEnv(agent.EnvProcPrioMgmt) appears a few times. I'm wondering if we should cover it with a dedicated function.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It's only really used here, in the other place we check the map passed to the agent which is better for tests, so I don't think this needs any change at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

My only concern is the future when somebody decides to introduce another variable and forgets to correct it in the test. Anyway, let's assume it is sort of nitpick 👍

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.

LGTM once CI is happy!

@mafredrimafredriforce-pushed themafredri/refactor-agentssh-config branch frome151c86 to112a0d0CompareFebruary 19, 2024 12:24
@mafredrimafredriforce-pushed themafredri/refactor-agentssh-config branch 2 times, most recently fromb9895ac toffae4adCompareFebruary 19, 2024 13:45
@mafredrimafredriforce-pushed themafredri/refactor-agentssh-config branch fromffae4ad todd66b45CompareFebruary 19, 2024 14:02
@mafredrimafredri merged commitc63f569 intomainFeb 19, 2024
@mafredrimafredri deleted the mafredri/refactor-agentssh-config branchFebruary 19, 2024 14:30
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 19, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mtojekmtojekmtojek approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@mafredri@johnstcn@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp