Skip to content

fix: always expose packageName when known#1738

Merged
justandras merged 1 commit into
Sofie-Automation:mainfrom
bbc:justandras/fix/missing-package-names
May 11, 2026
Merged

fix: always expose packageName when known#1738
justandras merged 1 commit into
Sofie-Automation:mainfrom
bbc:justandras/fix/missing-package-names

Conversation

@justandras
Copy link
Copy Markdown
Member

About the Contributor

This pull request is posted on behalf of the BBC

Type of Contribution

This is a:

Bug fix

Current Behavior

The package names are not exposed in some broken states and as a result they are not reliably available over the LSG.

New Behavior

Package now falls back to the filename or to getMediaObjectMediaId(piece, sourceLayer).

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

  • This PR affects the piece content status publication

Time Frame

Not urgent, but we would like to get this merged into the in-development release.

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@justandras justandras self-assigned this Apr 30, 2026
@justandras justandras added the Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) label Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2ffbe71-bd7b-4209-9cfb-bc0e09161c29

📥 Commits

Reviewing files that changed from the base of the PR and between bcff27a and 064098d.

📒 Files selected for processing (2)
  • meteor/server/publications/pieceContentStatusUI/__tests__/checkPieceContentStatus.test.ts
  • meteor/server/publications/pieceContentStatusUI/checkPieceContentStatus.ts

Walkthrough

The changes refine packageName derivation logic in content status checking and add comprehensive test coverage. The implementation updates three code paths to properly handle filename mapping scenarios, while test additions validate correct behavior across media object matching, filename mismatches, and the ignoreMediaObjectStatus flag state.

Changes

Cohort / File(s) Summary
Test Coverage Expansion
meteor/server/publications/pieceContentStatusUI/__tests__/checkPieceContentStatus.test.ts
Adds per-test isolation by clearing MediaObjects collection. Introduces two new assertion groups: one validating packageName derivation when content.fileName matches or mismatches mediainfo.name, and another verifying packageName behavior when ignoreMediaObjectStatus is enabled.
Package Name Derivation Updates
meteor/server/publications/pieceContentStatusUI/checkPieceContentStatus.ts
Updates three early return paths: mock status path now uses a fake preview filename; "ignoreMediaStatus" fallback derives packageName from getMediaObjectMediaId(); media-object status path falls back to computed fileName when metadata?.mediaId is absent.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: ensuring packageName is always exposed when known, which directly addresses the bug fix described in the PR.
Description check ✅ Passed The description is clearly related to the changeset, explaining the current behavior (packageName not exposed in broken states), the new behavior (fallback to filename or getMediaObjectMediaId), and the testing approach.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ns/pieceContentStatusUI/checkPieceContentStatus.ts 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@justandras justandras merged commit 58ca72d into Sofie-Automation:main May 11, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contribution from BBC Contributions sponsored by BBC (bbc.co.uk)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants