Skip to content

ci: circle CI voter and release jobs#35

Open
bd82 wants to merge 2 commits intomainfrom
circleci
Open

ci: circle CI voter and release jobs#35
bd82 wants to merge 2 commits intomainfrom
circleci

Conversation

@bd82
Copy link
Copy Markdown

@bd82 bd82 commented Feb 16, 2021

No description provided.

@bd82
Copy link
Copy Markdown
Author

bd82 commented Feb 16, 2021

resolves #22

@matthew-dean:

Build failures

There seems to be a cyclic dependency, which needs to be resolved for the build to succeed.

image

Publishing

I recommend we merge this PR and fix the project structure in a different PR.

@matthew-dean
Copy link
Copy Markdown
Member

You will need to insert a secure env variable into circleci called NPM_TOKEN to enable publishing to npmjs.com from circleci

Do I want to do that? 😬 I've been doing it locally with lerna publish and then I get the benefit of choosing a version. I'm not sure I want to automate publishing; that seems too scary. Can you talk through how that works in practice?

@matthew-dean
Copy link
Copy Markdown
Member

Re: the cyclic dependency - Yes, I built a Rollup plugin for Jess, but ended up using it in the Jess command-line to create JS bundles. I'm not sure how to resolve that. I want to expose both libraries to NPM. Both need each other. And for me, that's only caused build warnings and not errors, I thought. 🤔

Comment thread .circleci/config.yml
version: 2
voter:
jobs:
- build-node12
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You're sure Node 10 isn't needed? I'm still personally on that version for work stuff. 🤷‍♂️

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We can always add it later, but node10 will reach EOL in ~2 months, so maybe it is not worth it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds fair.

@bd82
Copy link
Copy Markdown
Author

bd82 commented Feb 17, 2021

Do I want to do that? 😬 I've been doing it locally with lerna publish and then I get the benefit of choosing a version. I'm not sure I want to automate publishing; that seems too scary. Can you talk through how that works in practice?

The version choosing still happens manually by the user (see CONTRIBUTING.md release section).
Only the publishing happens on circleci which is safer and more consistent than your local dev env.
The publishing in CI is triggered by a new tag being pushed by lerna version, the specific of the tag version (minor/major/patch) is still chosen by the user...

In the future we could use semantic versioning and then lerna automatically selects the version according to the commit history.

Basically the publishing is automated, but the versioning is not.

@bd82
Copy link
Copy Markdown
Author

bd82 commented Feb 17, 2021

Re: the cyclic dependency - Yes, I built a Rollup plugin for Jess, but ended up using it in the Jess command-line to create JS bundles. I'm not sure how to resolve that. I want to expose both libraries to NPM. Both need each other. And for me, that's only caused build warnings and not errors, I thought. 🤔

It is tricky, I once had an issue like that with a programmatic API (not CLI) and had to inject some implementations using DI to avoid a direct dependency. Not sure what to do about your CLI use case.

The reason it works for you locally may be because it is using a previously built version of the rollup plugin to bundle your resources but in the CI env there is no such previous version.

Basically these cyclic deps often create issues when there are build steps involved in the project.
You could perhaps try to workaround the problem by running a compilation step first project wide and only then running the
CI build (minus compilation).

But it is best if you can figure out a way to avoid this cycle, as issues with it will likely keep popping up in different scenarios (that was my personal experience)

@matthew-dean
Copy link
Copy Markdown
Member

The version choosing still happens manually by the user

Okay, that makes sense.

But it is best if you can figure out a way to avoid this cycle, as issues with it will likely keep popping up in different scenarios (that was my personal experience)

I'll see what I can do. Thanks!

@matthew-dean
Copy link
Copy Markdown
Member

@bd82 If I can resolve this cyclic dependency, would I just run lerna ci locally to verify it's working?

@bd82
Copy link
Copy Markdown
Author

bd82 commented Feb 17, 2021

If I can resolve this cyclic dependency, would I just run lerna ci locally to verify it's working?

I think you would run:

  • lerna clean (to remove all node_modules dirs)
  • ensure root node_modules was also cleaned (if not rm -rf node_modules)
  • yarn ci

yarn ci will run the top level ci script which will run lerna ci and also some other root level validations (currently linting)

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.

2 participants