Skip to content

Fix 4.89.2 Docker publish: add missing GetSoftwareInstallerMetadataByTeamTitleAndInstallerID - #49760

Merged
georgekarrv merged 2 commits into
rc-patch-fleet-v4.89.2from
fix-docker-publish-4.89.2-missing-installer-method
Jul 22, 2026
Merged

Fix 4.89.2 Docker publish: add missing GetSoftwareInstallerMetadataByTeamTitleAndInstallerID#49760
georgekarrv merged 2 commits into
rc-patch-fleet-v4.89.2from
fix-docker-publish-4.89.2-missing-installer-method

Conversation

@georgekarrv

@georgekarrv georgekarrv commented Jul 22, 2026

Copy link
Copy Markdown
Member

Related issue: N/A — RC branch build/CI fix

What & why

The Docker publish for 4.89.2 on rc-patch-fleet-v4.89.2 was failing to compile, and the mysql test suite + Go linters were red — all from the same root cause: a broken cherry-pick.

1. Missing datastore method (broke Docker publish + all binary builds):

server/datastore/mysql/software_installers.go:748:30:
  ds.GetSoftwareInstallerMetadataByTeamTitleAndInstallerID undefined

The FMA patch-policy fix (#49519, commit 9603e84cc4) was cherry-picked in, bringing a caller of GetSoftwareInstallerMetadataByTeamTitleAndInstallerID, but the method itself was introduced on main by the large "Multiple packages API changes" feature PR (#48607), which is not part of this release.

2. Stale test assertion (broke mysql test suite + lint/lint-incremental typecheck):

server/datastore/mysql/software_installers_test.go:6362:11:
  assignment mismatch: 2 variables but ds.RecordPolicyQueryExecutions returns 1 value

The same cherry-pick brought a test that calls RecordPolicyQueryExecutions expecting ([]uint, error) (its signature on main), but on this RC branch it returns just error. A non-compiling test package fails both the mysql suite and the linter's typecheck pass.

Fix

  • Added GetSoftwareInstallerMetadataByTeamTitleAndInstallerID as a self-contained, minimal addition (interface + datastore impl + regenerated mock), refactoring GetSoftwareInstallerMetadataByTeamAndTitleID to share a private helper that takes an optional installer ID. The nil path preserves existing behavior exactly; a non-nil ID selects that specific package by si.id.
  • Fixed the stale test call to match the RC branch's single-return signature (the discarded first return value is simply dropped).

No production behavior change for existing callers.

Checklist for submitter

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

  • Confirmed that the fix is not expected to adversely impact load test results

…leAndInstallerID

The FMA patch-policy fix (#49519) was cherry-picked into this RC branch,
bringing a caller of ds.GetSoftwareInstallerMetadataByTeamTitleAndInstallerID
without the method itself (which lives in the larger #48607 feature PR that is
not part of this release). This broke compilation and failed the Docker publish:

  software_installers.go:748: ds.GetSoftwareInstallerMetadataByTeamTitleAndInstallerID
  undefined (type *Datastore has no field or method ...)

Add the method as a self-contained addition using the RC branch's existing
metadata query, refactored to share a helper that takes an optional installer
ID. The nil case preserves the existing GetSoftwareInstallerMetadataByTeamAndTitleID
behavior exactly; a non-nil installer ID selects that specific package.
@georgekarrv
georgekarrv requested a review from a team as a code owner July 22, 2026 16:55
…n RC branch

The FMA patch-policy test cherry-picked in with #49519 calls
RecordPolicyQueryExecutions expecting ([]uint, error) (its signature on main),
but on this RC branch it returns just error. The non-compiling test package
failed both the mysql test suite and the Go linters' typecheck pass. Drop the
unused first return value to match the RC signature.
@georgekarrv
georgekarrv merged commit 058c06d into rc-patch-fleet-v4.89.2 Jul 22, 2026
25 checks passed
@georgekarrv
georgekarrv deleted the fix-docker-publish-4.89.2-missing-installer-method branch July 22, 2026 18:17
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (rc-patch-fleet-v4.89.2@d404c44). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                    @@
##             rc-patch-fleet-v4.89.2   #49760   +/-   ##
=========================================================
  Coverage                          ?   69.09%           
=========================================================
  Files                             ?     1702           
  Lines                             ?   197057           
  Branches                          ?        0           
=========================================================
  Hits                              ?   136161           
  Misses                            ?    46807           
  Partials                          ?    14089           
Flag Coverage Δ
backend 69.09% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants