Skip to content

DB migration: Add require_all column to installers labels tables#41279

Merged
mna merged 1 commit intofeat-installers-labels-include-allfrom
mna-40721-installers-labels-include-all
Mar 10, 2026
Merged

DB migration: Add require_all column to installers labels tables#41279
mna merged 1 commit intofeat-installers-labels-include-allfrom
mna-40721-installers-labels-include-all

Conversation

@mna
Copy link
Copy Markdown
Member

@mna mna commented Mar 9, 2026

Related issue: (partially) Resolves #40721

PR for the DB changes only, targeting a feature branch as this is started in the 4.83 sprint but the story will land only in 4.84, so it must not make it to main until next sprint.

Checklist for submitter

Database migrations

  • Checked schema for all modified table for columns that will auto-update timestamps during migration.

_, err = tx.Exec(`ALTER TABLE vpp_app_team_labels ADD COLUMN require_all BOOL NOT NULL DEFAULT false`)
if err != nil {
return fmt.Errorf("failed to add require_all to vpp_app_team_labels: %w", err)
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We currently support labels_include_any and labels_exclude_any, so there's no data changes needed to existing rows (require_all needs to be set to 0/false for those 2 cases, which will be the case by default).

@mna mna marked this pull request as ready for review March 9, 2026 19:08
@mna mna requested a review from a team as a code owner March 9, 2026 19:08
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 46.66667% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.34%. Comparing base (6527ab7) to head (0f6272d).
⚠️ Report is 1 commits behind head on feat-installers-labels-include-all.

Files with missing lines Patch % Lines
...ftwareInstallerVPPAppInHouseAppIncludeAllLabels.go 46.66% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##           feat-installers-labels-include-all   #41279      +/-   ##
======================================================================
- Coverage                               66.34%   66.34%   -0.01%     
======================================================================
  Files                                    2477     2478       +1     
  Lines                                  198439   198454      +15     
  Branches                                 8854     8854              
======================================================================
+ Hits                                   131660   131663       +3     
- Misses                                  54877    54883       +6     
- Partials                                11902    11908       +6     
Flag Coverage Δ
backend 68.12% <46.66%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@mna mna merged commit f8fa379 into feat-installers-labels-include-all Mar 10, 2026
45 checks passed
@mna mna deleted the mna-40721-installers-labels-include-all branch March 10, 2026 12:22
@jahzielv jahzielv mentioned this pull request Mar 19, 2026
10 tasks
georgekarrv added a commit that referenced this pull request Mar 19, 2026
- **DB migration: Add `require_all` column to installers labels tables
(#41279)**
- **Backend: Support labels_include_all for installers/apps (#41324)**
- **ui impl for labels include all (#41836)**

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #39916

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] 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

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

## Database migrations

- [x] Checked schema for all modified table for columns that will
auto-update timestamps during migration.

## New Fleet configuration settings

- [x] Verified that the setting is exported via `fleetctl
generate-gitops`
- [x] Verified the setting is documented in a separate PR to [the GitOps
documentation](https://github.com/fleetdm/fleet/blob/main/docs/Configuration/yaml-files.md#L485)
- [x] Verified that the setting is cleared on the server if it is not
supplied in a YAML file (or that it is documented as being optional)
- [x] Verified that any relevant UI is disabled when GitOps mode is
enabled
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