Skip to content

Commit a251a13

Browse files
authored
Uprade coana and fix --org used with reach (#713)
* fix an issue where the wrong org slug was passed to the Coana process when the org slug was provided through --org * upgrade Coana to 14.11.14
1 parent 175772a commit a251a13

5 files changed

Lines changed: 18 additions & 10 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"@babel/preset-typescript": "7.27.1",
8585
"@babel/runtime": "7.28.3",
8686
"@biomejs/biome": "2.2.0",
87-
"@coana-tech/cli": "14.11.13",
87+
"@coana-tech/cli": "14.11.14",
8888
"@cyclonedx/cdxgen": "11.6.0",
8989
"@dotenvx/dotenvx": "1.48.4",
9090
"@eslint/compat": "1.3.2",

src/commands/fix/coana-fix.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export async function coanaFix(
7979
...ids,
8080
...fixConfig.unknownFlags,
8181
],
82-
{ cwd, spinner, env: { SOCKET_ORG_SLUG: orgSlug } },
82+
fixConfig.orgSlug,
83+
{ cwd, spinner },
8384
)
8485
: undefined
8586

src/commands/scan/perform-reachability-analysis.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ export async function performReachabilityAnalysis(
144144
env['SOCKET_BRANCH_NAME'] = branchName
145145
}
146146

147-
const coanaResult = await spawnCoana(coanaArgs, {
147+
// Run Coana with the manifests tar hash.
148+
const coanaResult = await spawnCoana(coanaArgs, orgSlug, {
148149
cwd,
149150
env,
150151
spinner,

src/utils/coana.mts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function extractTier1ReachabilityScanId(
2525

2626
export async function spawnCoana(
2727
args: string[] | readonly string[],
28+
orgSlug?: string,
2829
options?: SpawnOptions | undefined,
2930
extra?: SpawnExtra | undefined,
3031
): Promise<CResult<string>> {
@@ -37,9 +38,14 @@ export async function spawnCoana(
3738
if (defaultApiToken) {
3839
mixinsEnv['SOCKET_CLI_API_TOKEN'] = defaultApiToken
3940
}
40-
const orgSlugCResult = await getDefaultOrgSlug()
41-
if (orgSlugCResult.ok) {
42-
mixinsEnv['SOCKET_ORG_SLUG'] = orgSlugCResult.data
41+
42+
if (orgSlug) {
43+
mixinsEnv['SOCKET_ORG_SLUG'] = orgSlug
44+
} else {
45+
const orgSlugCResult = await getDefaultOrgSlug()
46+
if (orgSlugCResult.ok) {
47+
mixinsEnv['SOCKET_ORG_SLUG'] = orgSlugCResult.data
48+
}
4349
}
4450
try {
4551
const output = await spawn(

0 commit comments

Comments
 (0)