-
Notifications
You must be signed in to change notification settings - Fork 18
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
chore: fix circular dependencies related to assets.ts #1357
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1357 +/- ##
==========================================
- Coverage 79.57% 75.21% -4.36%
==========================================
Files 39 49 +10
Lines 1816 2255 +439
Branches 396 444 +48
==========================================
+ Hits 1445 1696 +251
- Misses 342 520 +178
- Partials 29 39 +10
|
src/cli/build.ts
Outdated
} else { | ||
zarf = assets.zarfYaml(yamlFile); | ||
zarf = await assets.zarfYaml(yamlFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zarf = await assets.zarfYaml(yamlFile); | |
zarf = await assets.zarfYaml(yamlFile); |
Why is this async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value is a Promise so the await is needed or you get:
Type 'Promise<string>' is not assignable to type 'string'.ts(2322)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed these by making the functions in assetsDeployer.ts no be async.
src/cli/build.ts
Outdated
@@ -180,9 +176,9 @@ export default function (program: RootCmd) { | |||
|
|||
let zarf = ""; | |||
if (opts.zarf === "chart") { | |||
zarf = assets.zarfYamlChart(chartPath); | |||
zarf = await assets.zarfYamlChart(chartPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be async
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed these by making the functions in assetsDeployer.ts no be async.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to clean up some async functions, needs further review. looks good though
src/cli/build.ts
Outdated
@@ -111,7 +103,9 @@ export default function (program: RootCmd) { | |||
// only actually build/push if there are files to include | |||
if (includedFiles.length > 0) { | |||
await createDockerfile(cfg.pepr.peprVersion, cfg.description, includedFiles); | |||
execSync(`docker build --tag ${image} -f Dockerfile.controller .`, { stdio: "inherit" }); | |||
execSync(`docker build --tag ${image} -f Dockerfile.controller .`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to the customImage flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it by accident when I was fixes merge conflicts yesterday.
src/lib/assets/assetsDeployer.ts
Outdated
return allYaml(this.assetsConfig, imagePullSecret); | ||
} | ||
|
||
async zarfYaml(path: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this just return some json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
src/lib/assets/assetsDeployer.ts
Outdated
return zarfYaml(this.assetsConfig, path); | ||
} | ||
|
||
async zarfYamlChart(path: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this just return some json? not async needed unless i am missing something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
this also breaks customImage and image in the build cli command |
Description
The assets modules have several circular dependencies between them. These should be fixed.
...
End to End Test:
Related Issue
Fixes #1340
Relates to #
Type of change
Checklist before merging