Skip to content

Conversation

evgeniy-scherbina
Copy link
Contributor

@evgeniy-scherbina evgeniy-scherbina commented Apr 28, 2025

Follow-up PR to #17458
Addresses this discussion: #17458 (comment)

@evgeniy-scherbina evgeniy-scherbina marked this pull request as ready for review April 28, 2025 18:38
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM with a couple nits

!errors.Is(err, prebuilds.ErrAGPLDoesNotSupportPrebuilds) {
!errors.Is(err, prebuilds.ErrAGPLDoesNotSupportPrebuiltWorkspaces) {
api.Logger.Error(ctx, "failed to claim prebuilt workspace", slog.Error(err),
slog.F("workspace_name", req.Name), slog.F("template_version_preset_id", req.TemplateVersionPresetID))
Copy link
Contributor

@dannykopping dannykopping Apr 28, 2025

Choose a reason for hiding this comment

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

I should've been more clear, sorry. I meant we should log when the error is of one of the expected types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. maybe let's log in both cases? Because if unexpected error is happened it also make sense to log? Or it will be logged on another level because handler failed?
  2. do you want to log it with error or warning? Because ErrNoClaimablePrebuiltWorkspaces is not an actual error? It can be normal situation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable. Warning for expected cases, error for unexpected 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dannykopping it became too wordy, but I guess it's okay?

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@evgeniy-scherbina evgeniy-scherbina merged commit a78f0fc into main Apr 28, 2025
29 checks passed
@evgeniy-scherbina evgeniy-scherbina deleted the yevhenii/512-claim-prebuild-follow-up-2 branch April 28, 2025 20:37
@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants