Skip to content

Pin Fleet-maintained apps - migration#47778

Merged
jkatz01 merged 2 commits into
mainfrom
47678-team-pins-migration
Jun 17, 2026
Merged

Pin Fleet-maintained apps - migration#47778
jkatz01 merged 2 commits into
mainfrom
47678-team-pins-migration

Conversation

@jkatz01

@jkatz01 jkatz01 commented Jun 17, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #47678

Checklist for submitter

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

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

  • 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.

  • Timeouts are implemented and retries are limited to avoid infinite loops

  • If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes

Testing

Summary by CodeRabbit

  • New Features

    • Teams can now pin software titles to designate preferred versions for tracking and management.
  • Chores

    • Database schema updated to support software title pinning.
    • Updated team deletion procedures to handle associated pins.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.23%. Comparing base (dbe9a34) to head (c19bc23).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...bles/20260617172853_CreateSoftwareTitleTeamPins.go 78.94% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #47778   +/-   ##
=======================================
  Coverage   67.22%   67.23%           
=======================================
  Files        3633     3634    +1     
  Lines      229795   229814   +19     
  Branches    11820    11820           
=======================================
+ Hits       154489   154513   +24     
+ Misses      61428    61424    -4     
+ Partials    13878    13877    -1     
Flag Coverage Δ
backend 68.85% <78.94%> (+<0.01%) ⬆️

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.

@jkatz01 jkatz01 marked this pull request as ready for review June 17, 2026 18:13
@jkatz01 jkatz01 requested a review from a team as a code owner June 17, 2026 18:13

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: db6c913b-b2ec-43d5-af78-62bec6db984a

📥 Commits

Reviewing files that changed from the base of the PR and between 2cb8509 and c19bc23.

📒 Files selected for processing (4)
  • server/datastore/mysql/migrations/tables/20260617172853_CreateSoftwareTitleTeamPins.go
  • server/datastore/mysql/migrations/tables/20260617172853_CreateSoftwareTitleTeamPins_test.go
  • server/datastore/mysql/schema.sql
  • server/datastore/mysql/teams.go

Walkthrough

A new MySQL migration (20260617172853) creates the software_title_team_pins table, which stores per-team software version pins keyed by a composite primary key of (team_id, title_id). The table includes a pinned_version string column and an auto-updating updated_at timestamp. A foreign key from title_id to software_titles(id) enforces referential integrity with ON DELETE CASCADE. The canonical schema.sql snapshot is updated to reflect the new table and incremented migration counter. DeleteTeam in teams.go is updated to include software_title_team_pins in its pre-deletion cleanup list. A corresponding migration test validates table creation, constraint enforcement, and cascade behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The migration creates the software_title_team_pins table with correct schema, adds cascade deletion in teams.go, includes comprehensive tests, but does not implement datastore functions like GetPinnedVersion or integration into GetFleetMaintainedVersionsByTitleID per issue #47678 requirements. Implement GetPinnedVersion, upsert/delete logic in softwareInstallerPayloadFromSlug, and plumb into GetFleetMaintainedVersionsByTitleID as specified in issue #47678 condition of satisfaction.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Pin Fleet-maintained apps - migration' directly refers to the core change: a database migration for implementing the pinned software version feature.
Description check ✅ Passed The description includes the related issue #47678 and completes the submission checklist. While most boxes are unchecked, the description properly identifies the PR scope as a database migration only.
Out of Scope Changes check ✅ Passed All changes (migration file, test file, schema.sql, teams.go teamRefs) are directly scoped to creating the table and ensuring referential integrity, with no extraneous modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 47678-team-pins-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jkatz01 jkatz01 merged commit 75a0a03 into main Jun 17, 2026
45 checks passed
@jkatz01 jkatz01 deleted the 47678-team-pins-migration branch June 17, 2026 19:29
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.

APRF: Persist pinned_version in software_title_team_pins join table

2 participants