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

Get ready for automated beta release, enable all C.I. checks #14

Merged
merged 12 commits into from
Feb 2, 2023

Conversation

NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Feb 1, 2023

What's included in this repo's C.I.?

  • assert that source maps and type-maps are generated
  • support multiple versions of typescript, per https://www.semver-ts.org/
  • support multiple versions of ember-source, to ensure a smooth upgrade path for downstream consumers
  • support embroider so that downstream consumers can be assured that their dependencies are "embroider strict mode safe"
  • test with no lockfile to try to catch unintended ecosystem deviations / breaking changes (such as what may happen with babel / rollup / etc)

(all of the above is standard in ember OSS projects 🎉 )

extra stuff for this repo:

  • publish the docs site and post the preview URLs to PRs
  • configure the auto-release system to do a series of beta versions until we're ready for 1.0.0

What is supported?

  • minimum ember-source 4.8 -- we can start pretty new, but this also allows us to use the nicest features. Additionally, since we are beta, we can move the minimum ember-source to whichever ember-source ships the built-in-types (as non-preview), without a breaking change
  • TS 4.8 and 4.9 -- we cannot support earlier than TS 4.8, because Glint does not support prior to TS 4.8
  • embroider-strict and classic builds

@NullVoxPopuli NullVoxPopuli changed the title Get ready for release, enable all C.I. checks Get ready for automated beta release, enable all C.I. checks Feb 1, 2023
@changeset-bot
Copy link

changeset-bot bot commented Feb 1, 2023

⚠️ No Changeset found

Latest commit: aa98d5c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

@@ -0,0 +1,10 @@
{
"mode": "pre",
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 configures our release automation to only do beta releases for now

Copy link
Contributor

Choose a reason for hiding this comment

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

How exactly does that work here? Will changeset pick a version for us? And if so, will it be a beta release like 1.0.0-beta.0, or will it be 0.x prereleases like 0.1.0?

Copy link
Contributor Author

@NullVoxPopuli NullVoxPopuli Feb 3, 2023

Choose a reason for hiding this comment

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

not sure when things are pre 1.0 -- I assume it'll do 1.0.0-beta.x until we turn off this mode. It'll also update the beta tag on npm -- I did a test with this on ember-toucan-styles, but that was for a 2.0.0 beta that I ended up abandoning -- current version is 1.0.5, and the next beta was 2.0.0-beta.0 -- so that made sense to me. I know pre 1.0 is kind of the wild west, so... we'll see!

Comment on lines +209 to +225
PostPreviewURLascommenttoPR:
name: Post Preview URL as comment to PR
runs-on: ubuntu-latest
needs: PublishDocstoCloudflarePages
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: ./.github/actions/pnpm
- uses: ./.github/actions/download-built-package
- uses: marocchino/sticky-pull-request-comment@v2
with:
message: |+
## Preview URLs
GH Env: ${{ needs.PublishDocstoCloudflarePages.outputs.env }}
docs: ${{ needs.PublishDocstoCloudflarePages.outputs.url }}
api docs: ${{ needs.PublishDocstoCloudflarePages.outputs.url }}/api/modules.html
Copy link
Contributor

@ynotdraw ynotdraw Feb 1, 2023

Choose a reason for hiding this comment

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

My second favorite part (first is releasing 😂 ) of all of this - preview URLs! 🎉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't yet have api docs, but when we do! this URL will be ready!
(I'm thinking for toucan-core, this makes the most sense for test-helpers and all that)

Copy link
Contributor

@ynotdraw ynotdraw Feb 1, 2023

Choose a reason for hiding this comment

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

(I'm thinking for toucan-core, this makes the most sense for test-helpers and all that)

makes sense to me 👍

@NullVoxPopuli
Copy link
Contributor Author

This PR addresses a real bug in ember-browser-services and unblocks this PR: CrowdStrike/ember-browser-services#364

@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review February 2, 2023 19:53
@@ -1,8 +1,8 @@
import '@glint/environment-ember-loose';
import '@glint/environment-ember-template-imports';
// Types from libraries
import '@crowdstrike/ember-oss-docs/glint';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

side-effecting imports are no longer recommended for merging the glint registry, because the number of copies of @glint/environment-ember-loose/registry in a project's node_modules is too variable.

},
"pnpm": {
"overrides": {
"@types/eslint": "^8.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ember-template-lint's dependency of @lint-todo brings in @types/eslint v7 🙈

@@ -76,6 +76,7 @@
"broccoli-asset-rev": "^3.0.0",
"concurrently": "^7.6.0",
"ember-auto-import": "^2.5.0",
"ember-browser-services": "^4.0.4",
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 works around an issue in embroider which will be fixed in the next release -- ultimately though, I think we may want to make this a peer eventually anyway, depending on what our components end up doing -- only time will tell though.

Copy link
Contributor

@ynotdraw ynotdraw left a comment

Choose a reason for hiding this comment

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

This is exciting!

Comment on lines +92 to +103
floating_tests:
name: Floating Deps Test
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Install Dependencies (without lockfile)
run: rm pnpm-lock.yaml && pnpm install
- uses: ./.github/actions/download-built-package
- run: pnpm --filter test-app test:ember
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the idea for these to catch cases where breaking changes are introduced by package authors not following proper semver?

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, either that, or accidental breaking changes, such as what happened recently here: wessberg/rollup-plugin-ts#202

Ultimately SemVer is a social contract, and as such, is prone to human error 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Totally! Makes sense to me. Thank ya for the context

Copy link
Contributor

Choose a reason for hiding this comment

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

Explains a lot to me too!

Copy link
Contributor

Choose a reason for hiding this comment

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

accidental breaking changes also includes bugs, which also tend to not follow semver 🤪

Even when that's not our fault, it's good to have visibility about things failing, to raise issues upstream and prevent "works on my machine"™ like scenarios...

@nicolechung
Copy link
Contributor

docs: https://0cc0132f.ember-toucan-core.pages.dev/

Woohoo! Docs!

@@ -85,7 +85,7 @@
"concurrently": "^7.2.1",
"ember-cli-htmlbars": "^6.1.1",
"ember-source": "~4.9.2",
"ember-template-lint": "^4.0.0",
"ember-template-lint": "^5.3.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow...so many packages updated in just a month

Copy link
Contributor

@nicolechung nicolechung left a comment

Choose a reason for hiding this comment

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

🎉

@NullVoxPopuli NullVoxPopuli merged commit 9be2d5f into main Feb 2, 2023
@NullVoxPopuli NullVoxPopuli deleted the get-ready branch February 2, 2023 22:09
Copy link
Contributor

@simonihmig simonihmig left a comment

Choose a reason for hiding this comment

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

Nice! 🚀

@@ -0,0 +1,10 @@
{
"mode": "pre",
Copy link
Contributor

Choose a reason for hiding this comment

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

How exactly does that work here? Will changeset pick a version for us? And if so, will it be a beta release like 1.0.0-beta.0, or will it be 0.x prereleases like 0.1.0?

"tag": "beta",
"initialVersions": {
"docs-app": "0.0.0",
"@crowdstrike/ember-toucan-core": "0.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

This depends on the answer to the previous question, but just to point this out: the 0.0.x releases are a bit tricky and awkward IMO, as according to how npm version modifiers work any new patch release like 0.0.x+1 is considered a breaking change, as ^0.0.1 would not allow 0.0.2 to be used. So unless our API is really like super unstable, I would start with 0.1.0 (as ^0.1.0 would cover all 0.1.x releases then).

Comment on lines +92 to +103
floating_tests:
name: Floating Deps Test
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Install Dependencies (without lockfile)
run: rm pnpm-lock.yaml && pnpm install
- uses: ./.github/actions/download-built-package
- run: pnpm --filter test-app test:ember
Copy link
Contributor

Choose a reason for hiding this comment

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

accidental breaking changes also includes bugs, which also tend to not follow semver 🤪

Even when that's not our fault, it's good to have visibility about things failing, to raise issues upstream and prevent "works on my machine"™ like scenarios...

persist-credentials: false
- uses: ./.github/actions/pnpm
- uses: ./.github/actions/download-built-package
- uses: marocchino/sticky-pull-request-comment@v2
Copy link
Contributor

Choose a reason for hiding this comment

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

I have used similar things before, but this one is really nice with its update capabilities! 😍

uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.UX_OSS_CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.UX_OSS_CLOUDFLARE_ACCOUNT_ID }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have the powers to see the repo/org secrets in this Github, so wondering, are these repo- or org-wide secrets? Or to rephrase: is this already available e.g. in the forms repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they are org-wide -- tokens configured in the org settings -- and are explicitly allowed per repo that needs them (as opposed to all repos by default) -- if forms is ready for docs, I can add these to the forms repo 🎉

- default_tests
- floating_tests
- typecheck
- try_scenarios
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we cannot split things up a bit into different workflows (like CI/release/docs) due to not being able to reference needs across workflows, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct

@@ -17,7 +17,7 @@ declare module '@ember/modifier' {
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
export default interface Registry extends OSSDocs {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -96,7 +96,7 @@
"postcss": "^8.2.14",
"prettier": "^2.8.3",
"prettier-plugin-ember-template-tag": "^0.3.0",
"rollup": "^2.67.0",
"rollup": "^3.12.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh! Yeah, I remember I wanted to update this also in the blueprint, but didn't look yet into what it takes (breaking changes)... seems... nothing?

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, looks like they did the 3.0 major the ember way,

  • drop old node
  • remove deprecated code
  • some internal stuff that doesn't matter to consumers

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.

4 participants