You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
GitLab NPM Scope adds second @ in orchestrator:release #1200
Describe the bug
After checking at multiple junctures what the issue may be, I have come to the conclusion that the failure in our pipelines could only stem from the duplicate @ that is prepended to the npm_scope, because I could verify that the artifact exists, and at all other places I was not able to find any traces. #1168 already had such a failure, but only publish.ts was fixed as a hotfix. It seems more than publish is affected.
To Reproduce
Steps to reproduce the behavior:
Update a Package using orchestrator:publish
Create a Pipeline for manual-release
Run a Pipeline for Staging or whatever Instance is chosen as the first one.
Expected behavior
Artifacts should be found and released to target Instance
Screenshots
Platform Details (please complete the following information):
OS: Using the Docker Image provided at ghcr.io/dxatscale/sfpowerscripts
Version [e.g. CLI Version eg: 1.6.6]: 20.2.11
Salesforce CLI(sfdx cli) Version: 1.179,9
CI Platform: GitLab
Additional context
Probably a follow up issue to #1168 as more than one script uses npm scope in a similar way to publish. For me, it happens when running the release command.
@vuha-acn Thanks for the heads-up but that doesn't do it for me. None of the --scope variables had an "@" to begin with. I did change the line you changed in the before_script, but at the end of it I still found it tried to pack @@salesforce-app/....
Going a little further, removing the "@" altogether will give me the correct npm-scope (as it only has one @), but the npm pack command still adds another one, because I think it expects the npm-scope to be without the prepended "@".
For the time being I was able to fix this by hard-coding the scope in both the before_script (with @ prepended) and in the --scope variables. For our current use case the single scope should be enough but I would appreciate a long-term fix that addresses this.
Yes, i've only hardcoded the '@' item below and removed any '@' on my NPM_SCOPE in my GitLab pipeline for CI/CD. That is basically the workaround now until we have time to investigate further.
After Realizing that my NPM_SCOPE variable did actually have an @ I didn't ask for, your workaround now also does the trick. So the script adjustment with prepending the @ to the before_script is the only adjustment I needed to make in the end.
Glad that was the case. The workaround works for me as I've been using GitLab for my pipelines for few projects and that is the current fix until we get a more long term fix in place. I'm working on updating the dxatscale-template just strapped for time recently.
Activity
vuha-acn commentedon Jan 23, 2023
@dschibster - To fix the error, I have done the following in the in the default section:
--scope "$NPM_SCOPE"I'll be updated the dxatscale-templates soon to reflect this and corresponding documentation.
dschibster commentedon Jan 24, 2023
@vuha-acn Thanks for the heads-up but that doesn't do it for me. None of the --scope variables had an "@" to begin with. I did change the line you changed in the before_script, but at the end of it I still found it tried to pack @@salesforce-app/....
dschibster commentedon Jan 24, 2023
Going a little further, removing the "@" altogether will give me the correct npm-scope (as it only has one @), but the npm pack command still adds another one, because I think it expects the npm-scope to be without the prepended "@".
@vuha-acn Can you make something of that?
dschibster commentedon Jan 24, 2023
For the time being I was able to fix this by hard-coding the scope in both the before_script (with @ prepended) and in the --scope variables. For our current use case the single scope should be enough but I would appreciate a long-term fix that addresses this.
vuha-acn commentedon Jan 24, 2023
Yes, i've only hardcoded the '@' item below and removed any '@' on my NPM_SCOPE in my GitLab pipeline for CI/CD. That is basically the workaround now until we have time to investigate further.
- echo "@${NPM_SCOPE}:registry=https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" >> .npmrcGlad you were able to get a short term work around in place.
dschibster commentedon Jan 25, 2023
After Realizing that my NPM_SCOPE variable did actually have an @ I didn't ask for, your workaround now also does the trick. So the script adjustment with prepending the @ to the before_script is the only adjustment I needed to make in the end.
vuha-acn commentedon Jan 26, 2023
Glad that was the case. The workaround works for me as I've been using GitLab for my pipelines for few projects and that is the current fix until we get a more long term fix in place. I'm working on updating the dxatscale-template just strapped for time recently.
fix(fetch): fix incorrect use of scope while fetching from npm
azlam-abdulsalam commentedon Feb 6, 2023
Fixed in Jan 23