Skip to content

feat: accept 15-char package version IDs in bundle definition file#1177

Open
sf-haulakh wants to merge 3 commits intot/packaging-distribution/bundle-enhancementfrom
t/packaging-distribution/accept-15char-apvid
Open

feat: accept 15-char package version IDs in bundle definition file#1177
sf-haulakh wants to merge 3 commits intot/packaging-distribution/bundle-enhancementfrom
t/packaging-distribution/accept-15char-apvid

Conversation

@sf-haulakh
Copy link
Copy Markdown
Collaborator

Summary

  • Adds automatic conversion of 15-character Salesforce package version IDs (04t prefix) to 18-character format when reading bundle definition files
  • Creates a temporary normalized definition file only when conversion is needed, preserving the original file
  • Includes cleanup of temporary files in a finally block

Test plan

  • Unit test: 15-char IDs are normalized to 18-char format
  • Unit test: nested packageVersion fields are handled recursively
  • Unit test: definition files with only 18-char IDs are passed through unchanged (no temp file created)
  • Manual test with a real bundle definition file containing 15-char 04t IDs

🤖 Generated with Claude Code

This change enables the sf package bundle version create command to
accept both 15-character and 18-character Salesforce package version
IDs (04t IDs) in the bundle definition file.

Previously, only 18-character IDs were supported, and providing a
15-character ID would result in an error: "No package version found
with alias: 04t5f000000WM9y"

Changes:
- Added convertTo18CharId() function to convert 15-char IDs to 18-char
  using the standard Salesforce ID checksum algorithm
- Added normalizePackageVersionIds() function to recursively search
  and normalize all packageVersion fields in the definition JSON
- Modified the run() method to read, normalize, and create a temporary
  definition file when 15-char IDs are detected
- Proper cleanup of temporary files in finally block
- Added comprehensive unit tests for ID normalization scenarios

Also added CLAUDE.md with codebase documentation for future AI instances.

Fixes: W-21383062

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@sf-haulakh sf-haulakh requested a review from a team as a code owner April 22, 2026 17:19
sf-haulakh and others added 2 commits April 22, 2026 23:01
…enhancement' into t/packaging-distribution/accept-15char-apvid
Move node:fs/path/os imports before third-party imports, extract
normalizeDefinitionFile, cleanupTempFile, and handleResult into
private methods to reduce run() complexity, and capture file content
inside test stubs before temp file cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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