Skip to content

feat: add agent timings #14713

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 57 commits into from
Sep 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
bcfacf7
feat: begin impl of agent script timings
DanielleMaywood Sep 17, 2024
d55b2e6
feat: add job_id and display_name to script timings
DanielleMaywood Sep 17, 2024
05d8a8b
fix: increment migration number
DanielleMaywood Sep 17, 2024
d54f6c3
fix: rename migrations from 251 to 254
DanielleMaywood Sep 18, 2024
d573c67
test: get tests compiling
DanielleMaywood Sep 18, 2024
09a1a42
fix: appease the linter
DanielleMaywood Sep 18, 2024
6d829f3
fix: get tests passing again
DanielleMaywood Sep 18, 2024
4df7831
fix: drop column from correct table
DanielleMaywood Sep 18, 2024
2565f0a
test: add fixture for agent script timings
DanielleMaywood Sep 18, 2024
669b837
fix: typo
DanielleMaywood Sep 18, 2024
df51673
fix: use job id used in provisioner job timings
DanielleMaywood Sep 18, 2024
c6d71d1
fix: increment migration number
DanielleMaywood Sep 18, 2024
a306e48
test: behaviour of script runner
DanielleMaywood Sep 18, 2024
4b0056c
test: rewrite test
DanielleMaywood Sep 18, 2024
14b68a1
test: does exit 1 script break things?
DanielleMaywood Sep 18, 2024
b22cb57
test: rewrite test again
DanielleMaywood Sep 18, 2024
ef5e2fe
fix: revert change
DanielleMaywood Sep 19, 2024
a5b412b
fix: let code breathe
DanielleMaywood Sep 19, 2024
57ebf30
fix: wrap errors
DanielleMaywood Sep 19, 2024
2a49f67
fix: justify nolint
DanielleMaywood Sep 19, 2024
0698584
fix: swap require.Equal argument order
DanielleMaywood Sep 19, 2024
3580069
fix: add mutex operations
DanielleMaywood Sep 19, 2024
9cb1252
feat: add 'ran_on_start' and 'blocked_login' fields
DanielleMaywood Sep 19, 2024
0b0d1ef
fix: update testdata fixture
DanielleMaywood Sep 19, 2024
eb857c1
fix: refer to agent_id instead of job_id in timings
DanielleMaywood Sep 19, 2024
586d88f
fix: JobID -> AgentID in dbauthz_test
DanielleMaywood Sep 19, 2024
b6289bb
fix: add 'id' to scripts, make timing refer to script id
DanielleMaywood Sep 19, 2024
863c3dc
fix: fix broken tests and convert bug
DanielleMaywood Sep 19, 2024
b8d5d1d
fix: update testdata fixtures
DanielleMaywood Sep 19, 2024
61c26ea
fix: update testdata fixtures again
DanielleMaywood Sep 19, 2024
7f8b6f9
feat: capture stage and if script timed out
DanielleMaywood Sep 20, 2024
c20ac32
fix: update migration number
DanielleMaywood Sep 20, 2024
c652133
test: add test for script api
DanielleMaywood Sep 20, 2024
1199b64
fix: fake db query
DanielleMaywood Sep 20, 2024
afa61eb
fix: use UTC time
DanielleMaywood Sep 20, 2024
8d325e2
fix: ensure r.scriptComplete is not nil
DanielleMaywood Sep 20, 2024
aeee582
fix: move err check to right after call
DanielleMaywood Sep 20, 2024
424069c
fix: uppercase sql
DanielleMaywood Sep 20, 2024
9b43a94
fix: use dbtime.Now()
DanielleMaywood Sep 20, 2024
ed31199
fix: debug log on r.scriptCompleted being nil
DanielleMaywood Sep 20, 2024
8814711
fix: ensure correct rbac permissions
DanielleMaywood Sep 20, 2024
0414623
chore: remove DisplayName
DanielleMaywood Sep 20, 2024
a8192a5
Merge branch 'main' into dm-add-agent-timings
DanielleMaywood Sep 20, 2024
08a466a
fix: get tests passing
DanielleMaywood Sep 20, 2024
8e7c757
fix: remove space in sql up
DanielleMaywood Sep 20, 2024
621071e
docs: document ExecuteOption
DanielleMaywood Sep 20, 2024
3b4df92
fix: drop 'RETURNING' from sql
DanielleMaywood Sep 20, 2024
44127b8
chore: remove 'display_name' from timing table
DanielleMaywood Sep 20, 2024
5846216
fix: testdata fixture
DanielleMaywood Sep 20, 2024
c43a143
fix: put r.scriptCompleted call in goroutine
DanielleMaywood Sep 23, 2024
13889bf
fix: track goroutine for test + use separate context for reporting
DanielleMaywood Sep 23, 2024
bf32b89
fix: appease linter, handle trackCommandGoroutine error
DanielleMaywood Sep 23, 2024
7fe6d8c
fix: resolve race condition
DanielleMaywood Sep 23, 2024
d7e86c6
feat: replace timed_out column with status column
DanielleMaywood Sep 23, 2024
6e338f2
test: update testdata fixture
DanielleMaywood Sep 23, 2024
79a620b
fix: apply suggestions from review
DanielleMaywood Sep 24, 2024
180307f
revert: linter changes
DanielleMaywood Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
revert: linter changes
  • Loading branch information
DanielleMaywood committed Sep 24, 2024
commit 180307fa45820d0b003aba9cadf4decebd192118
8 changes: 4 additions & 4 deletions cli/organizationsettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ func (r *RootCmd) setOrganizationSettings(orgContext *OrganizationContext, setti

settingJSON, err := json.Marshal(output)
if err != nil {
return xerrors.Errorf("failed to marshal organization setting %s: %w", inv.Args[0], err)
return fmt.Errorf("failed to marshal organization setting %s: %w", inv.Args[0], err)
}

var dst bytes.Buffer
err = json.Indent(&dst, settingJSON, "", "\t")
if err != nil {
return xerrors.Errorf("failed to indent organization setting as json %s: %w", inv.Args[0], err)
return fmt.Errorf("failed to indent organization setting as json %s: %w", inv.Args[0], err)
}

_, err = fmt.Fprintln(inv.Stdout, dst.String())
Expand Down Expand Up @@ -190,13 +190,13 @@ func (r *RootCmd) printOrganizationSetting(orgContext *OrganizationContext, sett

settingJSON, err := json.Marshal(output)
if err != nil {
return xerrors.Errorf("failed to marshal organization setting %s: %w", inv.Args[0], err)
return fmt.Errorf("failed to marshal organization setting %s: %w", inv.Args[0], err)
}

var dst bytes.Buffer
err = json.Indent(&dst, settingJSON, "", "\t")
if err != nil {
return xerrors.Errorf("failed to indent organization setting as json %s: %w", inv.Args[0], err)
return fmt.Errorf("failed to indent organization setting as json %s: %w", inv.Args[0], err)
}

_, err = fmt.Fprintln(inv.Stdout, dst.String())
Expand Down
Loading