Skip to content
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

use k6 cloud credentials #98

Merged
merged 3 commits into from
Feb 11, 2025
Merged

use k6 cloud credentials #98

merged 3 commits into from
Feb 11, 2025

Conversation

pablochacin
Copy link
Contributor

@pablochacin pablochacin commented Feb 10, 2025

Fixes #93
Fixes #94

Note to reviewers: this PR addresses the two requirements because it seams more coherent to use cloud token for authentication when the build service from GCK6 is used.

@pablochacin pablochacin force-pushed the use-k6-cloud-credentials branch from 734b84f to adfa019 Compare February 10, 2025 14:00
Signed-off-by: Pablo Chacin <[email protected]>
@pablochacin pablochacin force-pushed the use-k6-cloud-credentials branch from adfa019 to e7238d6 Compare February 10, 2025 14:05
@pablochacin pablochacin requested a review from szkiba February 10, 2025 14:20
@pablochacin pablochacin marked this pull request as ready for review February 10, 2025 14:20
@pablochacin pablochacin requested a review from a team as a code owner February 10, 2025 14:20
Collectors struct {
Cloud struct {
Token string `json:"token"`
} `json:"cloud"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

More FYI and not sure that we actually need workaround that, but until the k6 v0.50 the structure was different and had more layers, like ext.loadimpact was what currently cloud is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll open an issue and we can discuss if this is required.


// loadConfig loads the k6 config file from the given path or the default location.
// if using the default location and the file does not exist, it returns an empty config.
func loadConfig(configPath string) (k6configFile, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will be it difficult to add the debug logs here for success path, which we can enable by increasing verbosity (-v). Something like Resolved config: /home/oleg/.config/k6/config.json` which could be useful for us if we need to investigate the things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That will require some changes in the code as we are not logging anything at the moment. I will open an issue an address this in a follow-up PR.

Copy link
Collaborator

@szkiba szkiba left a comment

Choose a reason for hiding this comment

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

LGTM

@pablochacin pablochacin merged commit 775575b into main Feb 11, 2025
7 checks passed
@pablochacin pablochacin deleted the use-k6-cloud-credentials branch February 11, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants