Skip to content

Allow configuration of update URL#3720

Merged
MDrakos merged 8 commits intomasterfrom
miked/CP-1054
Aug 28, 2025
Merged

Allow configuration of update URL#3720
MDrakos merged 8 commits intomasterfrom
miked/CP-1054

Conversation

@MDrakos
Copy link
Member

@MDrakos MDrakos commented Aug 27, 2025

StoryCP-1054 The update url can be configured with `state config`

@MDrakos MDrakos requested a review from Naatan August 28, 2025 18:27
Copy link
Contributor

@Naatan Naatan left a comment

Choose a reason for hiding this comment

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

I don't think we need a global here either. The code paths for the updater are pretty limited and I think they already receive the config.

We still want to be avoiding global as much as we reasonably can. The api PR is the exception, not the rule.

@MDrakos MDrakos requested a review from Naatan August 28, 2025 21:36
Copy link
Contributor

@Naatan Naatan left a comment

Choose a reason for hiding this comment

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

Looks good! Two minor comments, up to you what you do with them.

e2e.OptAppendEnv(suite.env(false, false)...),
e2e.OptAppendEnv("VERBOSE=true"),
)
cp.ExpectExitCode(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

This really gives a zero exit code? I would imagine this will fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

The checker handles some 4xx codes without throwing an error. I think that's what's happening here.

ts := e2e.New(suite.T(), false)
defer ts.Close()

cp := ts.Spawn("config", "set", constants.UpdateEndpointConfig, "https://example.com/update")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I prefer to use something that's not an actual domain like test.tld. I can only imagine the traffic example.com sees :p

Copy link
Collaborator

Choose a reason for hiding this comment

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

example.com is not a valid domain. This is so you can use it in these contexts.

Copy link
Member Author

Choose a reason for hiding this comment

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

example.com is not a valid domain. This is so you can use it in these contexts.

I'm going to pretend that I knew that when I wrote this test 🙂

@MDrakos MDrakos merged commit 495860d into master Aug 28, 2025
3 of 8 checks passed
@MDrakos MDrakos deleted the miked/CP-1054 branch August 28, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants