Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(coderd/telemetry): add telemetry for database Tasks#20279

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 5 commits intomainfromcj/gh-coder-internal-981
Oct 17, 2025

Conversation

@johnstcn
Copy link
Member

@johnstcnjohnstcn commentedOct 13, 2025
edited
Loading

@johnstcnjohnstcn self-assigned thisOct 13, 2025
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981 branch from5eefbd7 to7b7d778CompareOctober 13, 2025 17:01
@johnstcnjohnstcn changed the base branch frommain tocj/gh-coder-internal-981-list-tasksOctober 13, 2025 17:01
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981 branch from7b7d778 to0f0801fCompareOctober 13, 2025 17:07
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981-list-tasks branch fromee92a76 toe901f8dCompareOctober 13, 2025 17:11
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981 branch 2 times, most recently fromd15c472 to55e34c6CompareOctober 13, 2025 17:19
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981-list-tasks branch frome901f8d to7b6e819CompareOctober 13, 2025 20:00
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981 branch from55e34c6 to777681aCompareOctober 13, 2025 20:01
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981-list-tasks branch from7b6e819 to4c1b0b2CompareOctober 14, 2025 11:14
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981 branch fromd87670a to9cc8e53CompareOctober 14, 2025 11:17
Base automatically changed fromcj/gh-coder-internal-981-list-tasks tomainOctober 14, 2025 16:33
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981 branch 5 times, most recently from4e74abd toebe0908CompareOctober 15, 2025 17:13
@johnstcnjohnstcnforce-pushed thecj/gh-coder-internal-981 branch fromebe0908 to213da47CompareOctober 15, 2025 17:46
Comment on lines 1564 to 1589
funcTask(t testing.TB,db database.Store,orig database.TaskTable) database.Task {
t.Helper()

parameters:=orig.TemplateParameters
ifparameters==nil {
parameters=json.RawMessage([]byte("{}"))
}

task,err:=db.InsertTask(genCtx, database.InsertTaskParams{
OrganizationID:orig.OrganizationID,
OwnerID:orig.OwnerID,
Name:takeFirst(orig.Name,taskname.GenerateFallback()),
WorkspaceID:orig.WorkspaceID,
TemplateVersionID:orig.TemplateVersionID,
TemplateParameters:parameters,
Prompt:orig.Prompt,
CreatedAt:takeFirst(orig.CreatedAt,dbtime.Now()),
})
require.NoError(t,err,"failed to insert task")

returntask
// Return the Task from the view instead of the TaskTable
fetched,err:=db.GetTaskByID(genCtx,task.ID)
require.NoError(t,err,"failed to fetch task")
require.Equal(t,task.ID,fetched.ID)

returnfetched
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

drive-by: modified this to return the view type instead

DanielleMaywood and mafredri reacted with thumbs up emoji
Comment on lines 1798 to 1799
TemplateParametersHash:fmt.Sprintf("%x",sha256.New().Sum(task.TemplateParameters)),
PromptHash:fmt.Sprintf("%x",sha256.New().Sum([]byte(task.Prompt))),
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I "defaulted" tosha256 here, but I'm open to other suggestions.

@johnstcnjohnstcn marked this pull request as ready for reviewOctober 15, 2025 18:07
Copy link
Contributor

@DanielleMaywoodDanielleMaywood left a comment

Choose a reason for hiding this comment

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

LGTM but will defer to Hugo for approval

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Except for the sha256, looks good 👍🏻

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
@johnstcnjohnstcn merged commitdc6e50d intomainOct 17, 2025
30 checks passed
@johnstcnjohnstcn deleted the cj/gh-coder-internal-981 branchOctober 17, 2025 09:48
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 17, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@DanielleMaywoodDanielleMaywoodDanielleMaywood left review comments

@mafredrimafredrimafredri approved these changes

@hugodutkahugodutkahugodutka approved these changes

Assignees

@johnstcnjohnstcn

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@johnstcn@mafredri@hugodutka@DanielleMaywood

[8]ページ先頭

©2009-2025 Movatter.jp