-
Notifications
You must be signed in to change notification settings - Fork 37
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
Bug/Question: Why is stepsToDownloadAssembly() called with cdkoutDir? #706
Comments
Hi @diranged, thanks for the ticket + the investigation, and I'm sorry I'm only now getting to this. This is not intentional and synthing should be deterministic. I plan on looking at some common failures this weekend, and will keep this in mind. If you have any additional thoughts let me know! |
@diranged there is one thing here though. I think you are doing extra work to get your app = new App({
outdir: '/tmp',
}); |
@kaizencc Hey ... thanks for the response. So we're not really using this library now, we're instead using https://github.com/Nextdoor/cdk-pipelines-github which does this in a more simple fashion I believe.. but I think my big question was - how are other people using this? Are they? This seemed like a pretty big issue at least from our perspective.. |
I would wager that others are almost certainly setting |
Problem
We're trying to leverage this library to run a few pipelines in our CDK project, and we were running into problems where each time the
npx projen build
was run, we got a modifieddeploy.yml
file. Each and every time we ran it, the diff changes:Digging through the code, I found that
stepsToDownloadAssembly()
is being called withtargetDir: cdkoutDir
. Tracing thecdkoutDir
back, we find that it's basically set toapp.outdir
atcdk-pipelines-github/src/pipeline.ts
Line 357 in e1d219e
What does this cause?
Each and every time the
build.yml
'sself-mutation
step runs, it detects a change to.github/workflows/deploy.yml
and commits that change, causing a build loop (presuming you have granted your Projen Github App with the right credentials so that it can mutate the workflow files).Our fix: Set CDK_OUTDIR
If we explicitly set the
CDK_OUTDIR
environment variable to/tmp
, we can convince the system to generate a consistentdeploy,yml
file:The trick was, how to do this programmatically? So we added a few hacks to our
.projenrc.ts
file:Question: Is this an intentional design decision?
My main question here is whether or not it is an intentional decision that the
deploy.yml
file would be mutated each and every time thatnpx projen build
is run? That seems pretty strange .. yet I can't find any evidence of other users complaining about this.The text was updated successfully, but these errors were encountered: