Skip to content

feat(coderd): add workspace timings endpoint #14648

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

Merged
merged 14 commits into from
Sep 16, 2024

Conversation

BrunoQuaresma
Copy link
Collaborator

Related to coder/internal#44

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.

Great work @BrunoQuaresma!
One minor suggestion but otherwise 👌

@BrunoQuaresma BrunoQuaresma merged commit 705b9cc into main Sep 16, 2024
30 checks passed
@BrunoQuaresma BrunoQuaresma deleted the bq/provisioner-timings-endpoint branch September 16, 2024 19:31
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2024
@@ -1791,6 +1791,10 @@ func (q *querier) GetProvisionerJobByID(ctx context.Context, id uuid.UUID) (data
return job, nil
}

func (q *querier) GetProvisionerJobTimingsByJobID(ctx context.Context, jobID uuid.UUID) ([]database.ProvisionerJobTiming, error) {
return q.db.GetProvisionerJobTimingsByJobID(ctx, jobID)
Copy link
Contributor

Choose a reason for hiding this comment

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

@BrunoQuaresma I missed this yesterday; we need to ensure the user can read the workspace build in order to read the timings, otherwise we might leak some information.

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't see any RBAC resource related to the workspace build. The closest that I see is the rbac.ResourceWorkspace, does it work?

Copy link
Member

Choose a reason for hiding this comment

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

I think you can take a look at GetProvisionerLogsAfterID. As you can see, it is assumed that if you can fetch Job from the database, you can also read Logs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mtojek even better, ty

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dannykopping
Copy link
Contributor

Closes coder/internal#43

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.

4 participants