Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add logging on ChooChooTrain #288

Merged
merged 19 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: always hash env name
  • Loading branch information
IgnacioBecerra committed Jan 22, 2025
commit d814db72ccd48da0ab69a68f2b66e8bdf93d3431
5 changes: 2 additions & 3 deletions src/main/core/choo-choo-train.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class ChooChooTrain extends Loggable {
this.scanId = scanHash.digest('hex')

// saving data to hash later
const envName = this.environment?.name ?? ''
const envName = this.environment?.name

const hashedData = hash(
{
Expand All @@ -319,8 +319,7 @@ export class ChooChooTrain extends Loggable {
CustomResourceAttributes.ANALYZED_PATH,
CustomResourceAttributes.ANALYZED_OWNER_PATH,
CustomResourceAttributes.ANALYZED_REPOSITORY,
CustomResourceAttributes.ANALYZED_REFS,
CustomResourceAttributes.ENVIRONMENT_NAME
CustomResourceAttributes.ANALYZED_REFS
]
)

Expand Down
8 changes: 3 additions & 5 deletions src/main/core/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ export class Environment {
this.cwd = config.cwd
}

if (this.name != '') {
const hash = createHash('sha256')
hash.update(this.name)
this.name = hash.digest('hex')
}
const hash = createHash('sha256')
hash.update(this.name)
this.name = hash.digest('hex')
}

/**
Expand Down
Loading