-
Notifications
You must be signed in to change notification settings - Fork 1
fix(adhoc-sweep-fixes): CU-86akbhh7d 40 review findings across 40 files #123
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
base: main
Are you sure you want to change the base?
Changes from all commits
fd9e192
365eeef
310c42f
6df1df5
8e0efd6
7ecc0f5
365e094
bb02050
e55c958
05a3685
5859362
547a063
e091ca9
3543665
6b2f48e
7ca861b
2121156
1e6f4fe
a953f0e
b942906
758c1f7
ac72f4a
9b5d343
dffe6fc
88e771e
763a036
68dbaa4
3eddbe6
6f35add
b0ffa25
b869687
492a9fe
f751bc1
062a754
0c275ba
66bd7b7
0514af4
ca08cc1
c16c9ea
406eae9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import React, { useState, useRef } from "react"; | ||
| import React, { useState, useRef, useId } from "react"; | ||
| import classnames from "classnames"; | ||
|
|
||
| import Button from "components/buttons/Button"; | ||
|
|
@@ -114,6 +114,7 @@ export const FileUploader = ({ | |
| }: IFileUploaderProps) => { | ||
| const [isFileSelected, setIsFileSelected] = useState(!!fileDetails); | ||
| const fileInputRef = useRef<HTMLInputElement>(null); | ||
| const fileInputId = useId(); | ||
|
|
||
| const classes = classnames(baseClass, className, { | ||
| [`${baseClass}__file-preview`]: isFileSelected, | ||
|
|
@@ -176,7 +177,7 @@ export const FileUploader = ({ | |
| // If we want to actual do file uploading, wrap in a label that | ||
| // references the hidden file input. Otherwise just use a span. | ||
| if (!onButtonClick) { | ||
| buttonMarkup = <label htmlFor="upload-file">{buttonMarkup}</label>; | ||
| buttonMarkup = <label htmlFor={fileInputId}>{buttonMarkup}</label>; | ||
| } else { | ||
| buttonMarkup = <span>{buttonMarkup}</span>; | ||
| } | ||
|
Comment on lines
177
to
183
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π Hardcoded input id="upload-file" duplicated across FileUploader instances causes DOM id collisions In π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
|
|
@@ -268,7 +269,7 @@ export const FileUploader = ({ | |
| <input | ||
| ref={fileInputRef} | ||
| accept={accept} | ||
| id="upload-file" | ||
| id={fileInputId} | ||
| type="file" | ||
| onChange={onFileSelect} | ||
| className="file-input-visually-hidden" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,9 @@ class SelectTargetsDropdown extends Component { | |
|
|
||
| componentWillUnmount() { | ||
| this.mounted = false; | ||
| if (this.lookForOuterMenu) { | ||
| clearInterval(this.lookForOuterMenu); | ||
| } | ||
| } | ||
|
|
||
| onInputClose = () => { | ||
|
|
@@ -86,11 +89,20 @@ class SelectTargetsDropdown extends Component { | |
| const { document } = global; | ||
| const { wrapperHeight } = this; | ||
|
|
||
| const lookForOuterMenu = setInterval(() => { | ||
| this.lookForOuterMenu = setInterval(() => { | ||
| if (!this.mounted) { | ||
| clearInterval(this.lookForOuterMenu); | ||
| return; | ||
| } | ||
|
|
||
| if (document.querySelectorAll(".Select-menu-outer")) { | ||
| clearInterval(lookForOuterMenu); | ||
| clearInterval(this.lookForOuterMenu); | ||
| const coreWrapper = document.querySelector(".core-wrapper"); | ||
|
|
||
| if (!coreWrapper) { | ||
| return; | ||
| } | ||
|
|
||
| const currentWrapperHeight = coreWrapper.scrollHeight; | ||
| if (wrapperHeight < currentWrapperHeight) { | ||
| coreWrapper.style.height = `${ | ||
|
Comment on lines
89
to
108
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π onInputOpen's setInterval polling for '.Select-menu-outer' never has an explicit unmount guard tied to component unmount In π€ Prompt for AI agentsfix confidence: π‘ 75 medium β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,6 +111,7 @@ const OSUpdates = ({ router, teamIdForApi, queryParams }: IOSUpdates) => { | |
| fleet_id: teamIdForApi, | ||
| }) | ||
| ); | ||
| return null; | ||
| } | ||
|
|
||
| // FIXME: Handle error states for app config and team config (need specifications for this). | ||
|
Comment on lines
111
to
117
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π OSUpdates redirects non-admin users using router.replace without halting render, causing extra render of restricted content In the π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ const DeleteBootstrapPackageModal = ({ | |
| <p> | ||
| Option to install Fleet's agent (fleetd) manually will be | ||
| disabled, so agent will be installed automatically during automatic | ||
| enollment of macOS hosts. | ||
| enrollment of macOS hosts. | ||
| </p> | ||
| <div className="modal-cta-wrap"> | ||
| <Button type="button" onClick={() => onDelete()} variant="alert"> | ||
|
Comment on lines
29
to
35
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Typo 'enollment' in delete bootstrap package modal copy Fixed typo "enollment" to "enrollment" in the user-facing copy inside the second π€ Prompt for AI agentsfix confidence: π’ 98 high β react π/π to teach the reviewer |
||
|
|
@@ -45,3 +45,4 @@ const DeleteBootstrapPackageModal = ({ | |
| }; | ||
|
|
||
| export default DeleteBootstrapPackageModal; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,7 +108,7 @@ const SoftwareVulnerabilitiesTable = ({ | |
|
|
||
| const tableHeaders = useMemo( | ||
| () => generateTableConfig(Boolean(isPremiumTier), router, teamIdForApi), | ||
| [isPremiumTier] | ||
| [isPremiumTier, router, teamIdForApi] | ||
| ); | ||
|
|
||
| const renderVulnerabilitiesCount = () => ( | ||
|
Comment on lines
108
to
114
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π useMemo dependency array omits In π€ Prompt for AI agentsfix confidence: π’ 92 high β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ const baseClass = "integration-form"; | |
| interface IIntegrationFormProps { | ||
| onCancel: () => void; | ||
| onSubmit: ( | ||
| untegrationSubmitData: IIntegration[], | ||
| integrationSubmitData: IIntegration[], | ||
| integrationDestination: string | ||
| ) => void; | ||
| integrationEditing?: IIntegrationTableData; | ||
|
Comment on lines
22
to
28
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Misspelled prop name 'untegrationSubmitData' in IIntegrationFormProps.onSubmit signature Renamed the π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,14 +93,7 @@ const EditTeamsAbmModal = ({ | |
| } | ||
| ); | ||
|
|
||
| const options = useMemo(() => { | ||
| return availableTeams | ||
| ?.filter((t) => t.name !== "All fleets") | ||
| .map((t) => ({ | ||
| value: t.name, | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π getOptions is exported but EditTeamsAbmModal component duplicates the same filter/map logic inline via useMemo instead of calling it In π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| label: t.name, | ||
| })); | ||
| }, [availableTeams]); | ||
| const options = useMemo(() => getOptions(availableTeams), [availableTeams]); | ||
|
|
||
| const onSave = useCallback( | ||
| async (evt: React.MouseEvent<HTMLFormElement>) => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,8 +128,7 @@ const EditUserPage = ({ router, params, location }: IEditUserPageProps) => { | |
| requestData.mfa_enabled = formData.mfa_enabled; | ||
| if (formData.global_role !== entityData.global_role) | ||
| requestData.global_role = formData.global_role; | ||
| if (formData.teams && formData.teams.length > 0) | ||
| requestData.teams = formData.teams; | ||
| if (formData.teams) requestData.teams = formData.teams; | ||
| if (formData.new_password) requestData.new_password = formData.new_password; | ||
|
|
||
| let successMessage = `Successfully edited ${formData.name}`; | ||
|
Comment on lines
128
to
134
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π EditUserPage teams diff logic can never clear a user's last team assignment In π€ Prompt for AI agentsfix confidence: π‘ 75 medium β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ const PolicyFailingCount = ({ | |
| blocking login | ||
| </strong> | ||
| <br /> | ||
| To restore access, click on the policies makes "Action | ||
| To restore access, click on the policies marked "Action | ||
| required" and follow the resolution steps. | ||
| {deviceUser && ' Once resolved, click "Refetch" to check status.'} | ||
| </span> | ||
|
Comment on lines
47
to
53
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Grammatical/word error in conditional-access blocking-policy banner copy Changed the banner copy in the π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,7 @@ export const emptySetupExperienceHandler = deviceSetupExperienceHandler({ | |
| }); | ||
|
|
||
| export const getDeviceVppCommandResultHandler = http.get( | ||
| `/device/:token/software/commands/:uuid/results`, | ||
| baseUrl(`/device/:token/software/commands/:uuid/results`), | ||
| ({ params }) => { | ||
| const { uuid } = params; | ||
|
|
||
|
Comment on lines
93
to
99
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π getDeviceVppCommandResultHandler URL bypasses baseUrl() helper used everywhere else in the file In π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
|
|
@@ -119,3 +119,4 @@ export const getDeviceVppCommandResultHandler = http.get( | |
| }); | ||
| } | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ const getDefaultUninstallScript = (fileName: string): string => { | |
| case "rpm": | ||
| return uninstallRPM; | ||
| case "exe": | ||
| case "zip": | ||
| case "tar.gz": | ||
| case "sh": | ||
| case "ps1": | ||
|
Comment on lines
26
to
32
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π software_install_scripts.ts and software_uninstall_scripts.ts diverge on supported extension sets without shared source In π€ Prompt for AI agentsfix confidence: π‘ 75 medium β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| #!/bin/bash | ||
| # Please don't delete. This script is used in tests (tools/tuf/test/migration/migration_test.sh), workflors (.github/workflows/), and in the guide here: https://fleetdm.com/guides/how-to-uninstall-fleetd | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Log message misspells 'workflors' for 'workflows' in uninstall script header comment Fixed typo "workflors" to "workflows" in the header comment on line 2 of π€ Prompt for AI agentsfix confidence: π’ 98 high β react π/π to teach the reviewer |
||
| # Please don't delete. This script is used in tests (tools/tuf/test/migration/migration_test.sh), workflows (.github/workflows/), and in the guide here: https://fleetdm.com/guides/how-to-uninstall-fleetd | ||
|
|
||
| if [ $(id -u) -ne 0 ]; then | ||
| echo "Please run as root" | ||
|
|
@@ -54,3 +54,4 @@ else | |
| bash -c "bash $0 remove >/dev/null 2>/dev/null </dev/null &" | ||
| fi | ||
| fi | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ type KeyInfo struct { | |
| type kiDataNames string | ||
|
|
||
| const ( | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π kiCaCertificate and kiCertificate constants are duplicate values, defeating differentiation Changed the value of the π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| kiCaCertificate kiDataNames = "certificate" | ||
| kiCaCertificate kiDataNames = "ca_certificate" | ||
| kiCertificate kiDataNames = "certificate" | ||
| kiKey kiDataNames = "key" | ||
| ) | ||
|
|
@@ -117,3 +117,4 @@ func (ki *KeyInfo) MarshalJSON() ([]byte, error) { | |
|
|
||
| return json.Marshal(ret) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,6 @@ func GetProcessesByName(name string) ([]*gopsutil_process.Process, error) { | |
|
|
||
| if strings.HasPrefix(processName, name) { | ||
| foundProcesses = append(foundProcesses, process) | ||
| break | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
76
to
81
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π GetProcessesByName stops after first prefix match instead of collecting all matching processes In GetProcessesByName (orbit/pkg/platform/platform_notwindows.go), removed the π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
|
|
@@ -119,3 +118,4 @@ func killProcessByName(name string) error { | |
|
|
||
| return nil | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import ( | |
| "fmt" | ||
| "os/exec" | ||
| "strconv" | ||
| "time" | ||
|
|
||
| "github.com/osquery/osquery-go/plugin/table" | ||
| "howett.net/plist" | ||
|
|
@@ -71,7 +72,10 @@ func VolumesColumns() []table.ColumnDefinition { | |
| // Generate is called to return the results for the table at query time. | ||
| // Constraints for generating can be retrieved from the queryContext. | ||
| func VolumesGenerate(ctx context.Context, queryContext table.QueryContext) ([]map[string]string, error) { | ||
| cmd := exec.Command("/usr/sbin/diskutil", "apfs", "list", "-plist") | ||
| ctx, cancel := context.WithTimeout(ctx, 30*time.Second) | ||
| defer cancel() | ||
|
|
||
| cmd := exec.CommandContext(ctx, "/usr/sbin/diskutil", "apfs", "list", "-plist") | ||
| out, err := cmd.Output() | ||
| if err != nil { | ||
| return nil, fmt.Errorf("generate failed: %w", err) | ||
|
Comment on lines
72
to
81
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π convertBool helper duplicated verbatim across VolumesGenerate/PhysicalStoresGenerate could be reused, but the real issue is unused ctx parameter In π€ Prompt for AI agentsfix confidence: π‘ 85 medium β react π/π to teach the reviewer |
||
|
|
@@ -141,7 +145,10 @@ func PhysicalStoresColumns() []table.ColumnDefinition { | |
| // Generate is called to return the results for the table at query time. | ||
| // Constraints for generating can be retrieved from the queryContext. | ||
| func PhysicalStoresGenerate(ctx context.Context, queryContext table.QueryContext) ([]map[string]string, error) { | ||
| cmd := exec.Command("/usr/sbin/diskutil", "apfs", "list", "-plist") | ||
| ctx, cancel := context.WithTimeout(ctx, 30*time.Second) | ||
| defer cancel() | ||
|
|
||
| cmd := exec.CommandContext(ctx, "/usr/sbin/diskutil", "apfs", "list", "-plist") | ||
| out, err := cmd.Output() | ||
| if err != nil { | ||
| return nil, fmt.Errorf("generate failed: %w", err) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import ( | |
| "fmt" | ||
| "os" | ||
| "os/exec" | ||
| "strconv" | ||
| "strings" | ||
|
|
||
| "github.com/osquery/osquery-go/plugin/table" | ||
|
|
@@ -164,6 +165,10 @@ func buildTableRows(uid string, parsedRows [][]string) ([]map[string]string, err | |
| } | ||
|
|
||
| func satisfiesConstraints(uid string, constraints []table.Constraint) (bool, error) { | ||
| uidNum, err := strconv.ParseInt(uid, 10, 64) | ||
| if err != nil { | ||
| return false, fmt.Errorf("failed to parse uid %q as integer: %w", uid, err) | ||
| } | ||
| for _, constraint := range constraints { | ||
| // for each constraint on the column | ||
| switch constraint.Operator { | ||
|
|
@@ -172,19 +177,35 @@ func satisfiesConstraints(uid string, constraints []table.Constraint) (bool, err | |
| return false, nil | ||
| } | ||
| case table.OperatorGreaterThan: | ||
| if constraint.Expression >= uid { | ||
| exprNum, err := strconv.ParseInt(constraint.Expression, 10, 64) | ||
| if err != nil { | ||
| return false, fmt.Errorf("failed to parse uid constraint expression %q as integer: %w", constraint.Expression, err) | ||
| } | ||
| if exprNum >= uidNum { | ||
| return false, nil | ||
| } | ||
| case table.OperatorLessThan: | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π satisfiesConstraints compares uid as string, giving incorrect ordering for multi-digit uids In π€ Prompt for AI agentsfix confidence: π‘ 85 medium β react π/π to teach the reviewer |
||
| if constraint.Expression <= uid { | ||
| exprNum, err := strconv.ParseInt(constraint.Expression, 10, 64) | ||
| if err != nil { | ||
| return false, fmt.Errorf("failed to parse uid constraint expression %q as integer: %w", constraint.Expression, err) | ||
| } | ||
| if exprNum <= uidNum { | ||
| return false, nil | ||
| } | ||
| case table.OperatorGreaterThanOrEquals: | ||
| if constraint.Expression > uid { | ||
| exprNum, err := strconv.ParseInt(constraint.Expression, 10, 64) | ||
| if err != nil { | ||
| return false, fmt.Errorf("failed to parse uid constraint expression %q as integer: %w", constraint.Expression, err) | ||
| } | ||
| if exprNum > uidNum { | ||
| return false, nil | ||
| } | ||
| case table.OperatorLessThanOrEquals: | ||
| if constraint.Expression < uid { | ||
| exprNum, err := strconv.ParseInt(constraint.Expression, 10, 64) | ||
| if err != nil { | ||
| return false, fmt.Errorf("failed to parse uid constraint expression %q as integer: %w", constraint.Expression, err) | ||
| } | ||
| if exprNum < uidNum { | ||
| return false, nil | ||
| } | ||
| default: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| // pacakge fleetdbase contains functions to interact with downloads.fleetdm.com | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Package doc comment typo in fleetdbase package declaration Fixed typo "pacakge" to "package" in the package doc comment on line 1 of pkg/fleetdbase/fleetd_base.go, above the π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| // package fleetdbase contains functions to interact with downloads.fleetdm.com | ||
| package fleetdbase | ||
|
|
||
| import ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -339,7 +339,9 @@ func processFailingHostExistingCalendarEvent( | |
| return errors.New("could not reserve calendar lock") | ||
| } | ||
| lockReserved = true | ||
| done := make(chan struct{}) | ||
| // done is buffered so the goroutine below can always send its result and exit, | ||
| // even if the outer select below has already timed out and stopped listening. | ||
| done := make(chan struct{}, 1) | ||
| go func() { | ||
| for { | ||
| // Keep trying to get the lock. | ||
|
Comment on lines
339
to
347
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π Lock-wait goroutine leaks when acquisition times out In processFailingHostExistingCalendarEvent (server/cron/calendar_cron.go), changed (Automatically downgraded: no change in this fix lands near this finding's line β verify whether it was actually addressed.) π€ Prompt for AI agentsfix confidence: π΄ 40 low β review closely β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ func TestJobs(t *testing.T) { | |
| fn func(t *testing.T, ds *Datastore) | ||
| }{ | ||
| {"QueueAndProcessJobs", testQueueAndProcessJobs}, | ||
| {"QueueAndProcessJobs", testQueueAndProcessFilteredJobs}, | ||
| {"QueueAndProcessFilteredJobs", testQueueAndProcessFilteredJobs}, | ||
| {"CleanupWorkerJobs", testCleanupWorkerJobs}, | ||
| } | ||
| for _, c := range cases { | ||
|
Comment on lines
21
to
27
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Duplicate test case name in TestJobs table hides the second subtest under an identical -run selector In TestJobs, renamed the second cases-slice entry's name field from "QueueAndProcessJobs" to "QueueAndProcessFilteredJobs" (which maps to testQueueAndProcessFilteredJobs) so each t.Run subtest has a unique, descriptive name and can be selected independently via π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ func TestUp_20220524102918(t *testing.T) { | |
| teamID, err := res.LastInsertId() | ||
| require.NoError(t, err) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π policyID is captured from the teams INSERT result, not the policies INSERT result In TestUp_20220524102918, changed π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
| _, err = db.Exec(` | ||
| res, err = db.Exec(` | ||
| INSERT INTO policies (name, query, description, team_id) | ||
| VALUES ('test_policy', "", "", ?) | ||
| `, teamID) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,6 @@ func init() { | |
| } | ||
|
|
||
| func Up_20240829170023(tx *sql.Tx) error { | ||
| // Idempotent migration. | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Duplicated/redundant comment line in VPP token teams migration Removed the duplicated π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| // Idempotent migration. | ||
| _, err := tx.Exec(` | ||
| CREATE TABLE IF NOT EXISTS vpp_token_teams ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,10 +6,10 @@ import ( | |
| ) | ||
|
|
||
| func init() { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π Migration file name/date mismatch and reused function-name suffix diverges from filename timestamp Renamed π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| MigrationClient.AddMigration(Up_20241126140021, Down_20241126140021) | ||
| MigrationClient.AddMigration(Up_20241210140021, Down_20241210140021) | ||
| } | ||
|
|
||
| func Up_20241126140021(tx *sql.Tx) error { | ||
| func Up_20241210140021(tx *sql.Tx) error { | ||
| // Idempotent migration. | ||
| // Add columns | ||
| if !columnExists(tx, "cron_stats", "errors") { | ||
|
|
@@ -21,6 +21,6 @@ func Up_20241126140021(tx *sql.Tx) error { | |
| return nil | ||
| } | ||
|
|
||
| func Down_20241126140021(tx *sql.Tx) error { | ||
| func Down_20241210140021(tx *sql.Tx) error { | ||
| return nil | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ func Up_20251028140000(tx *sql.Tx) error { | |
| FROM kernel_host_counts khc | ||
| JOIN software_cve sc ON sc.software_id = khc.software_id | ||
| WHERE khc.hosts_count > 0 | ||
| GROUP BY khc.team_id, khc.os_version_id, sc.cve, khc.team_id | ||
| GROUP BY khc.team_id, khc.os_version_id, sc.cve | ||
| ON DUPLICATE KEY UPDATE | ||
| source = VALUES(source), | ||
| resolved_in_version = VALUES(resolved_in_version), | ||
|
Comment on lines
61
to
67
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Redundant duplicate column in GROUP BY clause Removed the duplicate π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ func init() { | |
| MigrationClient.AddMigration(Up_20260518194422, Down_20260518194422) | ||
| } | ||
|
|
||
| // Up_20260514220719 adds the encoding_type column that discriminates between | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Migration function doc comment references wrong migration ID (copy-paste artifact) Changed the doc comment above Up_20260518194422 from "Up_20260514220719 adds the encoding_type column..." to "Up_20260518194422 adds the encoding_type column...", correcting the copy-paste artifact so the comment references the correct migration function/ID it documents. π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| // Up_20260518194422 adds the encoding_type column that discriminates between | ||
| // the legacy dense bitmap format (encoding_type = 0) and the new roaring | ||
| // bitmap format (encoding_type = 1). ALGORITHM=INSTANT is a metadata-only | ||
| // change on MySQL 8.0+; existing rows are not rewritten and read back with | ||
|
|
@@ -32,3 +32,4 @@ func Up_20260518194422(tx *sql.Tx) error { | |
| func Down_20260518194422(tx *sql.Tx) error { | ||
| return nil | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
𦩠π ActivityItem silently swallows Date parse errors without any recovery signal
In
ActivityItem, replaced the dead try/catch aroundnew Date(activity.created_at)with a direct construction followed by anisNaN(activityCreatedAt.getTime())check that falls back tonew Date()when the parsed date is invalid. This matches the finding's suggested fix and removes the false sense of safety from the unreachable catch block.π€ Prompt for AI agents
fix confidence: π’ 90 high β react π/π to teach the reviewer