Skip to content

@W-23111346@ fix: remove erroneous _vN suffix stripping from publish developerName - #310

Merged
nico-pappagianis merged 1 commit into
mainfrom
W-23111346/fix/remove-publish-devname-replace
Jun 30, 2026
Merged

@W-23111346@ fix: remove erroneous _vN suffix stripping from publish developerName#310
nico-pappagianis merged 1 commit into
mainfrom
W-23111346/fix/remove-publish-devname-replace

Conversation

@nico-pappagianis

Copy link
Copy Markdown
Collaborator

What does this PR do?

Removes an erroneous .replace(/_v\d$/, '') call in ScriptAgentPublisher.validateDeveloperName() that was silently stripping a trailing _vN version suffix from the agent's developerName.

The developer name now comes through verbatim from globalConfiguration.developerName, so the publisher resolves the authoring bundle directory and *.bundle-meta.xml file using the agent's actual name. Previously, any agent whose developer name legitimately ended in _vN (e.g. my_agent_v1) had that suffix dropped, causing the bundle lookup to target the wrong name and fail with CannotFindBundle.

What issues does this PR fix or reference?

Users with _v<N> in their agent API name would not be able to have their agent bundles found for publish.

@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Nico Pappagianis <n***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

Comment thread test/testData.ts
schemaVersion: '2.0',
globalConfiguration: {
developerName: 'test_agent_v1',
developerName: 'test_agent',

@nico-pappagianis nico-pappagianis Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This test data is only used by agentPublisher.test.ts and encodes incorrect behavior.

agentPublisher.test.ts tests validated that the developer name's _v<N> was stripped which should not happen. Developer names should not be altered for bundle lookup.

This is likely a misunderstood implementation of versioning as described here, but it is an outright bug.

In other words, testing that we strip _v<N> from developer names is incorrect test behavior.

@nico-pappagianis
nico-pappagianis force-pushed the W-23111346/fix/remove-publish-devname-replace branch from 74fa396 to 560a3fa Compare June 25, 2026 19:51
@nico-pappagianis
nico-pappagianis force-pushed the W-23111346/fix/remove-publish-devname-replace branch from 560a3fa to 7bf7d92 Compare June 25, 2026 20:18
@nico-pappagianis
nico-pappagianis merged commit bb282b4 into main Jun 30, 2026
42 of 62 checks passed
@nico-pappagianis
nico-pappagianis deleted the W-23111346/fix/remove-publish-devname-replace branch June 30, 2026 23:46
nico-pappagianis added a commit to salesforcecli/plugin-agent that referenced this pull request Jul 1, 2026
Picks up forcedotcom/agents#310, which removes erroneous _vN suffix
stripping from the publish developerName.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants