-
Notifications
You must be signed in to change notification settings - Fork 1
fix(adhoc-sweep-fixes): CU-86akj32d7 21 review findings across 22 files #170
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
96527d1
b7db533
3872eea
b392feb
4d06641
8ee753c
08b0085
21e7846
b4ce032
10b19cd
ee46810
91eff8c
75c0a95
df71a21
c5deab4
ac786b9
193e3a9
aba1ed2
9056b5d
36e97ab
d862ac3
a886642
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 |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| module.exports = { | ||
|
|
||
|
|
||
| friendlyName: 'Ensure trial license key', | ||
|
|
||
|
|
||
| description: 'Generate and persist a Fleet Premium trial license key for the given user if they do not already have one.', | ||
|
|
||
|
|
||
| inputs: { | ||
|
|
||
| user: { | ||
| type: 'ref', | ||
| description: 'The logged-in user record (this.req.me) to check and possibly update.', | ||
| required: true, | ||
| } | ||
|
|
||
| }, | ||
|
|
||
|
|
||
| exits: { | ||
|
|
||
| success: { | ||
| outputDescription: 'The trial license key for this user, along with whether it is expired.', | ||
| outputType: { | ||
| trialLicenseKey: 'string', | ||
| userHasExpiredTrialLicense: 'boolean', | ||
| } | ||
| } | ||
|
|
||
| }, | ||
|
|
||
|
|
||
| fn: async function ({user}) { | ||
|
|
||
| let userHasExpiredTrialLicense = false; | ||
| let trialLicenseKey; | ||
|
|
||
| if(user.fleetPremiumTrialLicenseKey) { | ||
| if(user.fleetPremiumTrialLicenseKeyExpiresAt < Date.now()) { | ||
| userHasExpiredTrialLicense = true; | ||
| } | ||
| trialLicenseKey = user.fleetPremiumTrialLicenseKey; | ||
| } else { | ||
| // If this user does not have a trial license key, generate a new one for them. | ||
| let thirtyDaysFromNowAt = Date.now() + (1000 * 60 * 60 * 24 * 30); | ||
| let trialLicenseKeyForThisUser = await sails.helpers.createLicenseKey.with({ | ||
| numberOfHosts: 10, | ||
| organization: user.organization ? user.organization : 'Fleet Premium trial', | ||
| expiresAt: thirtyDaysFromNowAt, | ||
| }); | ||
| // Save the trial license key to the DB record for this user. | ||
| await User.updateOne({id: user.id}) | ||
| .set({ | ||
| fleetPremiumTrialLicenseKey: trialLicenseKeyForThisUser, | ||
| fleetPremiumTrialLicenseKeyExpiresAt: thirtyDaysFromNowAt, | ||
| }); | ||
| trialLicenseKey = trialLicenseKeyForThisUser; | ||
| } | ||
|
|
||
| return { | ||
| trialLicenseKey, | ||
| userHasExpiredTrialLicense, | ||
| }; | ||
|
|
||
| } | ||
|
|
||
|
|
||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,4 +26,5 @@ have caused repeated breakage. | |
|
|
||
| EOF | ||
|
|
||
| exit 1 | ||
| exit 0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import ( | |
| "errors" | ||
| "fmt" | ||
| "strconv" | ||
| "sync" | ||
|
|
||
| "github.com/AbGuthrie/goquery/v2" | ||
| gqconfig "github.com/AbGuthrie/goquery/v2/config" | ||
|
|
@@ -26,6 +27,7 @@ type activeQuery struct { | |
|
|
||
| type goqueryClient struct { | ||
| client *service.Client | ||
| mu sync.Mutex | ||
| queryCounter int | ||
| queries map[string]activeQuery | ||
| // goquery passes the UUID, while we need the hostname (or ID) to | ||
|
|
@@ -62,7 +64,9 @@ func (c *goqueryClient) CheckHost(query string) (gqhosts.Host, error) { | |
| return gqhosts.Host{}, fmt.Errorf("host %s not found", query) | ||
| } | ||
|
|
||
| c.mu.Lock() | ||
| c.hostnameByUUID[host.UUID] = host.Hostname | ||
| c.mu.Unlock() | ||
|
|
||
| return gqhosts.Host{ | ||
| UUID: host.UUID, | ||
|
Comment on lines
64
to
72
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. 𦩠π΅ hostnameByUUID map also written without synchronization alongside queries map Added a π€ Prompt for AI agentsfix confidence: π‘ 85 medium β react π/π to teach the reviewer |
||
|
|
@@ -73,32 +77,41 @@ func (c *goqueryClient) CheckHost(query string) (gqhosts.Host, error) { | |
| } | ||
|
|
||
| func (c *goqueryClient) ScheduleQuery(uuid, query string) (string, error) { | ||
| c.mu.Lock() | ||
| c.queryCounter++ | ||
| queryName := strconv.Itoa(c.queryCounter) | ||
|
|
||
| hostname, ok := c.hostnameByUUID[uuid] | ||
| if !ok { | ||
| c.mu.Unlock() | ||
| return "", errors.New("could not lookup host") | ||
| } | ||
| c.mu.Unlock() | ||
|
|
||
| res, err := c.client.LiveQuery(query, nil, []string{}, []string{hostname}) | ||
| if err != nil { | ||
| return "", err | ||
| } | ||
|
|
||
| c.mu.Lock() | ||
| c.queries[queryName] = activeQuery{status: "Pending"} | ||
| c.mu.Unlock() | ||
|
|
||
| // We need to start a separate thread due to goquery expecting | ||
| // scheduling a query and retrieving results to be separate | ||
| // operations. | ||
| go func() { | ||
| select { | ||
| case hostResult := <-res.Results(): | ||
| c.mu.Lock() | ||
| c.queries[queryName] = activeQuery{status: "Completed", results: hostResult.Rows} | ||
| c.mu.Unlock() | ||
|
|
||
| // Print an error | ||
| case err := <-res.Errors(): | ||
| c.mu.Lock() | ||
| c.queries[queryName] = activeQuery{status: "error: " + err.Error()} | ||
| c.mu.Unlock() | ||
| } | ||
| }() | ||
|
|
||
|
|
@@ -107,7 +120,9 @@ func (c *goqueryClient) ScheduleQuery(uuid, query string) (string, error) { | |
| } | ||
|
|
||
| func (c *goqueryClient) FetchResults(queryName string) (gqmodels.Rows, string, error) { | ||
| c.mu.Lock() | ||
| res, ok := c.queries[queryName] | ||
| c.mu.Unlock() | ||
| if !ok { | ||
| return nil, "", fmt.Errorf("Unknown query %s", queryName) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,7 +134,7 @@ remove_receipt_files() { | |
| fi | ||
|
|
||
| echo "sudo pkgutil --only-files --files \"$PKGID\" | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" | tr '\\\\n' '\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf" | ||
|
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. 𦩠π΅ remove_receipt_files uses INSTALL_LOCATION directly instead of the computed FULL_INSTALL_LOCATION for the file removal sed pattern In π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| sudo pkgutil --only-files --files "$PKGID" | sed "s|^|/${INSTALL_LOCATION}/|" | tr '\n' '\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf | ||
| sudo pkgutil --only-files --files "$PKGID" | sed "s|^|${FULL_INSTALL_LOCATION}/|" | tr '\n' '\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf | ||
|
|
||
| echo "sudo pkgutil --only-dirs --files \"$PKGID\" | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" | grep '\\.app$' | tr '\\\\n' '\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf" | ||
| sudo pkgutil --only-dirs --files "$PKGID" | sed "s|^|${FULL_INSTALL_LOCATION}/|" | grep '\.app$' | tr '\n' '\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,10 +33,16 @@ quit_application() { | |
|
|
||
| restart_zoom() { | ||
|
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 quit/relaunch helper logic across webex_install.sh and zoom_install.sh with divergent robustness Modified π€ Prompt for AI agentsfix confidence: π΄ 45 low β review closely β react π/π to teach the reviewer |
||
| local console_user="$1" | ||
|
|
||
| if [[ -n "$console_user" && "$console_user" != "root" ]]; then | ||
| echo "Restarting Zoom for user: $console_user" | ||
| sudo -u "$console_user" open -a "zoom.us" | ||
| local console_uid | ||
| console_uid=$(id -u "$console_user" 2>/dev/null || echo "") | ||
| if [[ -n "$console_uid" ]]; then | ||
| launchctl asuser "$console_uid" sudo -u "$console_user" open -a "zoom.us" | ||
| else | ||
| sudo -u "$console_user" open -a "zoom.us" | ||
| fi | ||
| else | ||
| echo "No console user found, attempting direct Zoom start..." | ||
| open -a "zoom.us" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,6 @@ module.exports = { | |
| } | ||
| operatingSystemsInUse.push(osInfo); | ||
|
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. 𦩠π΅ get-compliance-information.js sorts an empty array before it is populated Removed the no-op line π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| } | ||
| complianceInformation.versionsInUse = _.sortByOrder(complianceInformation.versionsInUse, 'sortByName'); | ||
|
|
||
| let numberOfHostsToReport = await Host.count({teamApid: teamApid}); | ||
| let numberOfHostsOnThisTeamWithACompliantOs = await Host.count({operatingSystem: {in: idsOfCompliantOperatingSystems}, teamApid: teamApid}); | ||
|
|
@@ -264,3 +263,4 @@ module.exports = { | |
|
|
||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,9 +10,7 @@ const DROPDOWN_OPTIONS = [ | |
| { disabled: true, label: "Delete", value: "delete-query" }, | ||
| ]; | ||
| const PLACEHOLDER = "Actions"; | ||
| const ON_CHANGE = (value: string) => { | ||
|
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. 𦩠π΅ console.log left in test onChange stub instead of a jest mock Replaced the π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| console.log(value); | ||
| }; | ||
| const ON_CHANGE = () => {}; | ||
|
|
||
| describe("Actions dropdown", () => { | ||
| it("renders dropdown placeholder and options", async () => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,8 @@ import { renderWithSetup } from "test/test-utils"; | |
|
|
||
| import RevealButton from "./RevealButton"; | ||
|
|
||
| const SHOW_TEXT = "Advanced options"; | ||
|
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. 𦩠π΅ RevealButton hideText/showText test constants are identical strings, undermining show/hide assertions Changed the π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| const HIDE_TEXT = "Advanced options"; | ||
| const SHOW_TEXT = "Show advanced options"; | ||
| const HIDE_TEXT = "Hide advanced options"; | ||
| const TOOLTIP_CONTENT = "Customize logging type and platforms"; | ||
|
|
||
| describe("Reveal button", () => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,6 +144,7 @@ const AddCertModal = ({ | |
| nameEquals: "subject_alternative_name", | ||
| }); | ||
| const nameConflict = getErrorReason(e, { | ||
| nameEquals: "name", | ||
| reasonIncludes: "already exists", | ||
| }); | ||
| if (sanReason) { | ||
|
Comment on lines
144
to
150
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. 𦩠π΅ getErrorReason nameConflict check may match unrelated 'already exists' errors In π€ Prompt for AI agentsfix confidence: π‘ 70 medium β react π/π to teach the reviewer |
||
|
|
@@ -253,3 +254,4 @@ const AddCertModal = ({ | |
| }; | ||
|
|
||
| export default AddCertModal; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ const getPlatformMessage = (isAppStoreApp: boolean, isAndroidApp: boolean) => { | |
| </p> | ||
| <p> | ||
|
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. 𦩠π΅ Grammatically broken user-facing string in DeleteSoftwareModal platform message In π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| Pending installs and uninstalls will be canceled. If they have already | ||
| started, they won' be canceled, and the results won't appear | ||
| started, they won't be canceled, and the results won't appear | ||
| in Fleet. | ||
| </p> | ||
| </> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,9 @@ examples: |- | |
| useful when looking to see if vulnerable software is exposed to networks. | ||
|
|
||
| ``` | ||
| SELECT * FROM alf_exceptions; | ||
| SELECT * FROM alf_explicit_auths; | ||
| ``` | ||
| notes: This table is currently affected by a | ||
| [bug](https://github.com/osquery/osquery/issues/2322) and not returning | ||
| applications visible in the preferences interface. | ||
|
|
||
|
Comment on lines
4
to
+12
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. 𦩠π΅ alf_explicit_auths.yml example query references the wrong table name (alf_exceptions instead of alf_explicit_auths) Changed the SQL example under π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,5 +3,6 @@ examples: |- | |
| Find computers with a load average of 3.5 or higher over the last 15 minutes. | ||
|
|
||
| ``` | ||
| SELECT average from load_average WHERE period='15m' AND average|-=3.5; | ||
| SELECT average from load_average WHERE period='15m' AND average>=3.5; | ||
| ``` | ||
|
|
||
|
Comment on lines
3
to
+8
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. 𦩠π΅ schema/tables/load_average.yml example query uses invalid SQL operator syntax Replaced the invalid SQL operator π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ import ( | |
| "crypto/md5" // nolint:gosec // used only to hash for efficient comparisons | ||
| "encoding/hex" | ||
| "encoding/json" | ||
| "fmt" | ||
| "strings" | ||
| "testing" | ||
|
|
||
|
|
@@ -116,7 +115,6 @@ func TestUp_20250904091745(t *testing.T) { | |
| if err != nil { | ||
| t.Fatalf("failed to marshal integrationsJSON: %v", err) | ||
| } | ||
| fmt.Printf("Marshalled integrations_json: %s\n", string(integrationJSONBytes)) | ||
|
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. 𦩠π΅ Debug fmt.Printf left in migration test Removed the stray π€ Prompt for AI agentsfix confidence: π’ 97 high β react π/π to teach the reviewer |
||
|
|
||
| insertNDESPasswordStmt := `INSERT INTO mdm_config_assets (name, value, md5_checksum) VALUES (?, ?, UNHEX(?))` // nolint:gosec // just test data, not hardcoded credentials | ||
| _, err = db.Exec(insertNDESPasswordStmt, fleet.MDMAssetNDESPassword, ndesEncryptedPassword, md5ChecksumBytes(ndesEncryptedPassword)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,7 +157,7 @@ func testTeamsGetSetDelete(t *testing.T, ds *Datastore) { | |
| mdm_apple_configuration_profiles (profile_uuid, team_id, identifier, name, mobileconfig, checksum) | ||
| VALUES (?, ?, ?, ?, ?, ?)`, | ||
| fmt.Sprintf("uuid_%s", tt.name), | ||
| 0, | ||
| team.ID, | ||
| fmt.Sprintf("TestPayloadIdentifier_%s", tt.name), | ||
| fmt.Sprintf("TestPayloadName_%s", tt.name), | ||
| `<?xml version="1.0"`, | ||
|
Comment on lines
157
to
163
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. 𦩠π΅ testTeamsGetSetDelete hardcodes team_id=0 for adhoc SQL inserts unrelated to the actual team under test In testTeamsGetSetDelete's ad-hoc insert block, changed the literal π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
@@ -169,14 +169,14 @@ func testTeamsGetSetDelete(t *testing.T, ds *Datastore) { | |
| _, err = q.ExecContext(context.Background(), ` | ||
| INSERT INTO | ||
| mdm_windows_configuration_profiles (team_id, name, syncml, profile_uuid) | ||
| VALUES (?, ?, ?, ?)`, 0, fmt.Sprintf("TestPayloadName_%s", tt.name), `<?xml version="1.0"`, fmt.Sprintf("uuid_%s", tt.name)) | ||
| VALUES (?, ?, ?, ?)`, team.ID, fmt.Sprintf("TestPayloadName_%s", tt.name), `<?xml version="1.0"`, fmt.Sprintf("uuid_%s", tt.name)) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| _, err = q.ExecContext(context.Background(), ` | ||
| INSERT INTO | ||
| mdm_android_configuration_profiles (profile_uuid, team_id, name, raw_json) | ||
| VALUES (?, ?, ?, ?)`, fmt.Sprintf("uuid_%s", tt.name), 0, fmt.Sprintf("TestPayloadName_%s", tt.name), `{"foo": "bar"}`) | ||
| VALUES (?, ?, ?, ?)`, fmt.Sprintf("uuid_%s", tt.name), team.ID, fmt.Sprintf("TestPayloadName_%s", tt.name), `{"foo": "bar"}`) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
@@ -970,7 +970,7 @@ func testTeamConflictsWithName(t *testing.T, ds *Datastore) { | |
| // e + combining acute accent). | ||
| reneeCombined, err := ds.NewTeam(ctx, &fleet.Team{Name: "RenΓ©e"}) | ||
| require.NoError(t, err) | ||
| reneeDecomposed := "ReneΜe" // e + U+0301 COMBINING ACUTE ACCENT | ||
| reneeDecomposed := "RenΓ©e" // e + U+0301 COMBINING ACUTE ACCENT | ||
| conflict, err = ds.TeamConflictsWithName(ctx, reneeDecomposed, 0) | ||
| require.NoError(t, err) | ||
| require.Equal(t, reneeCombined.ID, conflict.ID) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -225,3 +225,4 @@ func TestABMToken(t *testing.T) { | |
| require.True(t, ds.GetAllMDMConfigAssetsByNameFuncInvoked) | ||
| require.True(t, ds.GetABMTokenByOrgNameFuncInvoked) | ||
| } | ||
|
|
||
|
Comment on lines
225
to
+228
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. 𦩠π΅ No test coverage added for new CACertsAndKeyForDecryption / CADecryptRetriever logic No test was added for π€ Prompt for AI agentsfix confidence: π΄ 15 low β review closely β react π/π to teach the reviewer |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,8 +132,7 @@ func (svc *Service) ConditionalAccessMicrosoftConfirm(ctx context.Context) (conf | |
|
|
||
| getResponse, err := svc.conditionalAccessMicrosoftProxy.Get(ctx, integration.TenantID, integration.ProxyServerSecret) | ||
|
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. 𦩠π΅ conditionalAccessMicrosoftConfirmResponse silently returns false/empty on proxy Get failure instead of propagating the error In π€ Prompt for AI agentsfix confidence: π‘ 75 medium β react π/π to teach the reviewer |
||
| if err != nil { | ||
| svc.logger.ErrorContext(ctx, "failed to get integration settings from proxy", "err", err) | ||
| return false, "", nil | ||
| return false, "", ctxerr.Wrap(ctx, err, "failed to get integration settings from proxy") | ||
| } | ||
|
|
||
| if !getResponse.SetupDone { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,11 +19,11 @@ var vulnCSVs embed.FS | |
| // VulnsOptions configures the vuln seeder. Counts are per-platform; pass 0 | ||
| // to skip a platform. DSN is a MySQL connection string. | ||
| type VulnsOptions struct { | ||
|
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. 𦩠π΅ VulnsOptions field name Renamed the π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| DSN string | ||
| MacOS int | ||
| Ubuntu int | ||
| Windows int | ||
| BatchSiz int | ||
| DSN string | ||
| MacOS int | ||
| Ubuntu int | ||
| Windows int | ||
| BatchSize int | ||
| } | ||
|
|
||
| // Vulns writes plausible-looking software rows directly to MySQL so the | ||
|
|
@@ -41,8 +41,8 @@ type VulnsOptions struct { | |
| // from these rows on their own. | ||
| func Vulns(ctx context.Context, log Logger, opt VulnsOptions) Result { | ||
| res := Result{Entity: "vulns"} | ||
| if opt.BatchSiz <= 0 { | ||
| opt.BatchSiz = 500 | ||
| if opt.BatchSize <= 0 { | ||
| opt.BatchSize = 500 | ||
| } | ||
|
|
||
| dsn, err := mysqlDSN(opt.DSN, true) | ||
|
|
@@ -80,7 +80,7 @@ func Vulns(ctx context.Context, log Logger, opt VulnsOptions) Result { | |
| res.Errors = append(res.Errors, fmt.Errorf("read %s: %w", p.file, err)) | ||
| continue | ||
| } | ||
| if err := insertSoftware(ctx, db, p.platform, rows, p.count, opt.BatchSiz); err != nil { | ||
| if err := insertSoftware(ctx, db, p.platform, rows, p.count, opt.BatchSize); err != nil { | ||
| res.Errors = append(res.Errors, fmt.Errorf("insert %s: %w", p.platform, err)) | ||
| continue | ||
| } | ||
|
|
||
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.
𦩠π΅ install-wine.sh always exits non-zero even though it succeeds at its actual job (printing a message)
Changed
exit 1toexit 0at the end ofassets/scripts/install-wine.shso the informational script reports success instead of failure, since its sole purpose (per the file's own comment) is to print a message to users hitting the legacy /install-wine redirect, and a non-zero exit could cause automation (fleetctl/CI) piping this viacurl | shto treat it as an error.π€ Prompt for AI agents
fix confidence: π‘ 85 medium β react π/π to teach the reviewer