Skip to content

fix property names#35

Merged
efectn merged 2 commits intomasterfrom
fix-json
Dec 21, 2025
Merged

fix property names#35
efectn merged 2 commits intomasterfrom
fix-json

Conversation

@efectn
Copy link
Copy Markdown
Member

@efectn efectn commented Dec 21, 2025

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 21, 2025

Walkthrough

JSON tags for the exported ReleaseFile struct fields were changed: DistroRelease tag distro_releasedistro, KernelBranch tag kernel_branchbranch, ImageVariant tag image_variantvariant, and Preinstalled tag preinstalled_applicationfile_application. In loadMapJSON, extension-handling logic was adjusted so that when a special extension mapping is written, the code breaks out of the extension loop (stopping further extension checks) and continues processing with the resolved mapping; tag matching and extension handling were updated accordingly. Test fixtures were updated to use the new field names.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Changes combine public JSON tag renames and a behavioral change in loadMapJSON.
  • Review focus:
    • Consumers, tests, or docs that serialize/deserialize ReleaseFile with old JSON tags.
    • The new break in loadMapJSON to ensure it doesn't skip legitimate extension matches or create regressions.
    • Correctness of special-extension matching and any edge cases.

Possibly related PRs

Suggested reviewers

  • igorpecovnik

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to evaluate whether any description content is related to the changeset. Add a description explaining the purpose of the property name changes and their impact on the codebase.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix property names' is directly related to the changeset, which updates JSON struct field tags in the ReleaseFile struct from legacy names to new names.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-json

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 30d937c and 49e5eec.

📒 Files selected for processing (1)
  • map_test.go (6 hunks)
🔇 Additional comments (4)
map_test.go (4)

30-33: LGTM! Field names updated correctly.

The JSON field names have been updated to match the new struct tags, ensuring proper deserialization.


65-68: LGTM! Field names updated consistently across multiple assets.

Both assets in this test case correctly use the new field names, including testing file_application with both empty and non-empty values.

Also applies to: 88-91


117-120: LGTM! Field names updated consistently across all assets.

All three test assets correctly use the new field names, maintaining consistency with the other test cases and ensuring proper validation of extension handling logic.

Also applies to: 134-137, 151-154


30-33: All old field names have been removed from the codebase.

Verification confirms that distro_release, kernel_branch, image_variant, and preinstalled_application are no longer referenced in the Go codebase. The test fixture updates are consistent with the field name changes across all test cases.


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
map.go (1)

125-126: LGTM with optional simplification.

Extending image extensions to support U-Boot ROM files is appropriate.

🔎 Optional: Slightly cleaner variadic append
 	imageExtensions := maps.Keys(specialExtensions)
-	imageExtensions = append(imageExtensions, []string{"img.xz", "u-boot.rom.xz"}...) // extra allocation, but it's fine
+	imageExtensions = append(imageExtensions, "img.xz", "u-boot.rom.xz")

The variadic form accepts multiple arguments directly without needing to create an intermediate slice.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fe5b11d and 0b5a86e.

📒 Files selected for processing (1)
  • map.go (2 hunks)
🔇 Additional comments (1)
map.go (1)

117-123: LGTM!

The break statement is a correct fix. Without it, if multiple keys in specialExtensions matched the extension string, all would be appended to the builder in non-deterministic order (since Go map iteration order is random). This ensures only the first matching special extension suffix is applied.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
map.go (1)

118-123: Good fix: prevents multiple special extensions from being appended.

The break statement correctly ensures only one special extension value is appended to the string builder when a match is found. This prevents duplicate suffixes if multiple keys in specialExtensions match.

Note: Go map iteration order is non-deterministic. If multiple keys in specialExtensions could match the same file.Extension, the result would vary. Consider using a slice with priority ordering if deterministic behavior is required.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0b5a86e and 30d937c.

📒 Files selected for processing (1)
  • map.go (2 hunks)

@coderabbitai coderabbitai bot requested a review from igorpecovnik December 21, 2025 17:12
@efectn efectn merged commit 52b10c6 into master Dec 21, 2025
1 of 3 checks passed
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.

1 participant