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

expose client ID in config and on client #206

Merged
merged 2 commits into from
Feb 17, 2024
Merged

Conversation

bgentry
Copy link
Contributor

@bgentry bgentry commented Feb 16, 2024

Inspired by #203, I wanted to make the client IDs configurable by the user and also programmatically accessible (in the event a user decides to rely on auto-generated client IDs). This PR achieves both.

@bgentry bgentry requested a review from brandur February 16, 2024 15:56
@TC5027
Copy link
Contributor

TC5027 commented Feb 17, 2024

really neat thanks! :)

client.go Outdated
@@ -101,6 +101,15 @@ type Config struct {
// Defaults to 1 second.
FetchPollInterval time.Duration

// ID is the unique identifier for this client. If not set, a random ULID will
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about saying "random identifier" instead of "random ULID" here?

I'm kind of thinking that we shouldn't commit to the ULID algorithm specifically — it'd be nice to get rid of that dependency, and also I think a more human friendly combination of say host name plus start time might be a better default for operations anyway. Not something we need to do right now, but if we changed it, it'd a minor alteration of the contract above.

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 made that change and also relocated some relevant language that we had stashed on JobRow.AttemptedBy so that the full explanation is only given on the Config.ID field now.

@bgentry bgentry merged commit e6b9358 into master Feb 17, 2024
10 checks passed
@bgentry bgentry deleted the bg-expose-client-id branch February 17, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants