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

refactor: move pulumi interactions out of top-level example #407

Merged
merged 5 commits into from
Aug 11, 2022

Conversation

scottydawg
Copy link
Contributor

Some basic refactor and renaming things in the events example. This moves most of the pulumi-specific code out into a PulumiAwsDeployment object that any curious parties can drill down into, but abstracts it away for those that mostly care about reconciling with Nile. @sriramsub – is that more demo'able?

This also starts toward a path that could be a little more cloud-agnostic. (Or one that's not so tightly coupled to Pulumi, at least.)

@scottydawg scottydawg requested review from norwood and sriramsub August 9, 2022 14:23
@vercel
Copy link

vercel bot commented Aug 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nile-js ✅ Ready (Inspect) Visit Preview Aug 10, 2022 at 9:11PM (UTC)

@@ -24,7 +25,7 @@
"eslint": "^8.21.0",
"eslint-config-oclif": "^4",
"eslint-config-oclif-typescript": "^1.0.2",
"globby": "^13",
"globby": "^11",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was weird. I was getting an error with the ES6 import styles between oclif and globby. Had to downgrade to fix. Known issue with globby.

Error:

(node:84782) [ERR_REQUIRE_ESM] Error Plugin: @theniledev/events-example [ERR_REQUIRE_ESM]: require() of ES Module /Users/sdelamater/work/nile-js/packages/events-example/node_modules/globby/index.js from /Users/sdelamater/work/nile-js/node_modules/@oclif/core/lib/config/plugin.js not supported.
Instead change the require of index.js in /Users/sdelamater/work/nile-js/node_modules/@oclif/core/lib/config/plugin.js to a dynamic import() which is available in all CommonJS modules.
module: @oclif/core@1.13.0

@jrea
Copy link
Contributor

jrea commented Aug 9, 2022

If you're up for it, it would also be great to refactor EventsApi class out of the lib/nile/src/Nile.ts.

Comment on lines 109 to 121
// destroy any stacks that shouldnt exist
for (const id of Object.keys(stacks)) {
if (!instances[id]) {
this.destroyStack(id);
this.deployment.destroyStack(id);
}
}

// create any stacks that should exist
for (const id of Object.keys(instances)) {
if (!stacks[id]) {
this.createStack(instances[id]);
this.deployment.createStack(instances[id]);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@norwood - I'm seeing some inconsistencies with instances that get created then deleted before running this script. Still debugging synchronization issues.

acc[instance.id] = instance;
}
if (flags.statusCheckOnly) {
console.log({ stacks, instances });
Copy link
Contributor

@jrea jrea Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this.debug is more accurate. Also I think linting doesn't like this? or at least it shouldn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this leaked in from local debugging. I'll remove it.

@gwenshap
Copy link
Contributor

@scottydawg suggestion: instead of asking "is it more demoable?" (we won't know until we try), why not record yourself demoing this to an imaginary engineer?

@scottydawg scottydawg merged commit 75063a1 into master Aug 11, 2022
@jrea jrea deleted the refactor/events-example branch November 23, 2022 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants