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

Amend import order in auth templates according to ESLint rules introduced in v2.0 #6059

Merged
merged 3 commits into from
Aug 9, 2022

Conversation

Philzen
Copy link
Contributor

@Philzen Philzen commented Jul 27, 2022

No description provided.

@netlify
Copy link

netlify bot commented Jul 27, 2022

Deploy Preview for redwoodjs-docs canceled.

Name Link
🔨 Latest commit d4e3b86
🔍 Latest deploy log https://app.netlify.com/sites/redwoodjs-docs/deploys/62f278e37968b800082faa84

@nx-cloud
Copy link

nx-cloud bot commented Jul 27, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d4e3b86. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 14 targets

Sent with 💌 from NxCloud.

@jtoar jtoar assigned jtoar and unassigned callingmedic911 Jul 28, 2022
@jtoar jtoar added topic/crwa create-redwood-app release:fix This PR is a fix labels Jul 28, 2022
Copy link
Contributor

@jtoar jtoar left a comment

Choose a reason for hiding this comment

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

Looks good, thanks again @Philzen!

@jtoar
Copy link
Contributor

jtoar commented Jul 28, 2022

This PR changes a setup command, so leaving a quick note to myself to double check the fixtures.

@Philzen Philzen force-pushed the lint-dbauth-template branch 2 times, most recently from d78d50d to 6019f4f Compare August 8, 2022 00:29
@Philzen Philzen changed the title Amend dbAuth templates according to ESLint rules introduced in v2.0 Amend import order in auth templates according to ESLint rules introduced in v2.0 Aug 8, 2022
@Philzen Philzen force-pushed the lint-dbauth-template branch from 6019f4f to b5142e1 Compare August 8, 2022 00:30
@Philzen
Copy link
Contributor Author

Philzen commented Aug 8, 2022

This PR changes a setup command, so leaving a quick note to myself to double check the fixtures.

While working on #6159 i realized that there are multiple templates that needed import order fixes. I've fixed all of those now. As i'm currently trying to close off any open ends before i go silent for my summer hiatus, just wanted to quickly check back whether the fixtures are OK or anything needs to be done. I'm happy for you to add any necessary changes to this PR otherwise.


@jtoar as i am currently peeking into the .github-folder and can see you wrote a lot of the CI configuration (which is an art by itself, but a highly useful one!): the other day i was contemplating about the types of issues i'm seeing and working on, and i believe it's a good dozen now that all come down to the same thing: TypeScript or linting errors in code that is generated via CLI that would easily be detected via yarn rw lint

I can see that there is a linting job in the ci.yml, but i believe we should expand a little bit here. We'd need a smart test suite that executes each and every possible code-generating command (scaffolds, other generators, setup ui, setup auth) etc. on the generated test project, runs yarn rw lint after that on each of the generated files, and then hard resets again to continue with the next command (at least for some of them, i.e. for setup ui and auth it's either one or the other). If any of that comes back with an non-zero exit code, the pipeline would fail and PR authors would immediately know that they need to fix something.

What do you think? Would that be achievable? If you agree, maybe we should formulate an RFC for that.

From what i can see, that would have saved us dozens of individual "cleanup afterwards" PRs – and i can foresee many regressions happen over and over again, e.g. next time we change the ESLint rules, but also on simple changes to some of the more complex generators.

@Tobbe
Copy link
Member

Tobbe commented Aug 8, 2022

@Philzen Thanks for this. This is great. And I've made the same changes to my auth refactor PR #5985

This PR now needs the test project fixtures updated. So either you do that (fixtures/test-project/api/src/lib/auth.ts)
Or we close this PR and wait for my refactor PR to land. You decide :)

@Philzen
Copy link
Contributor Author

Philzen commented Aug 8, 2022

@Philzen Thanks for this. This is great. And I've made the same changes to my auth refactor PR #5985

This PR now needs the test project fixtures updated. So either you do that (fixtures/test-project/api/src/lib/auth.ts) Or we close this PR and wait for my refactor PR to land. You decide :)

@Tobbe I must be too tired / overworked but i'm simply not getting what i'd need to change in __fixtures__/test-project/api/src/lib/auth.ts (the import order seems fine in there), can you give me a hint?

Also, do i understand correctly that this file would also need to be synchronized for #6159 to go through?

As i already invested the effort, i'd of course prefer those to go through and claim the (albeit-so-little) fame 😉 But if you're saying this will create huge rebasing conflicts on your branch, and that is going to land soon (=early enough to ship in v2.3) you may close this.

Otherwise, i'd prefer you pushing the necessary change to this PR directly, enlighten me directly through that, and have those fixes merged and available for any users starting fresh with v2.3.

@Tobbe Tobbe added the fixture-ok Override the test project fixture check label Aug 8, 2022
@Tobbe Tobbe enabled auto-merge (squash) August 8, 2022 02:17
@Tobbe
Copy link
Member

Tobbe commented Aug 8, 2022

@Tobbe I must be too tired / overworked but i'm simply not getting what i'd need to change in __fixtures__/test-project/api/src/lib/auth.ts (the import order seems fine in there), can you give me a hint?

It's a weird hour for both of us 🙂

The bot isn't smart enough to know if anything actually needs to be updated. It just looks at what files were changed. I've overruled the bot, and have now enabled auto-merge

@Tobbe
Copy link
Member

Tobbe commented Aug 8, 2022

Also, do i understand correctly that this file would also need to be synchronized for #6159 to go through?

Yes, for that one you actually do have to update the fixture

As i already invested the effort, i'd of course prefer those to go through and claim the (albeit-so-little) fame 😉

Fame is well deserved! Of course you should have it

But if you're saying this will create huge rebasing conflicts on your branch, and that is going to land soon (=early enough to ship in v2.3) you may close this.

The next release is most likely going to be a breaking v3.0 release. Hopefully this or next week. I feel like I'm making good progress on the auth refactor, but I can't promise it'll be ready for v3. Especially since we'd need to update the api side too to take full advantage of the changes I'm making. And that work has only been started on an experimental level so far. No ongoing PR.

@Philzen Philzen force-pushed the lint-dbauth-template branch 2 times, most recently from 0e4bc7b to e9e9141 Compare August 8, 2022 23:34
auto-merge was automatically disabled August 8, 2022 23:36

Head branch was pushed to by a user without write access

@Philzen Philzen requested a review from Tobbe August 8, 2022 23:42
@Philzen
Copy link
Contributor Author

Philzen commented Aug 8, 2022

@Tobbe While finalizing #6061 i realized the imports in the dbAuth scaffolds were also not yet ordered accordingly and quickly added that on top as a separate commit. Kindly review / re-approve.

@Philzen Philzen force-pushed the lint-dbauth-template branch from 851d0b6 to 8e54e68 Compare August 9, 2022 01:25
@Philzen Philzen force-pushed the lint-dbauth-template branch from 8e54e68 to 5c821d2 Compare August 9, 2022 04:19
@jtoar jtoar enabled auto-merge (squash) August 9, 2022 15:10
@jtoar jtoar merged commit 06df623 into redwoodjs:main Aug 9, 2022
@redwoodjs-bot redwoodjs-bot bot added this to the next-release milestone Aug 9, 2022
@Philzen Philzen deleted the lint-dbauth-template branch August 9, 2022 17:20
dac09 added a commit to dac09/redwood that referenced this pull request Aug 9, 2022
…ac09/redwood into fix/user-scenarios-not-being-generated

* 'fix/user-scenarios-not-being-generated' of github.com:dac09/redwood:
  Amend import order in auth templates according to ESLint rules introduced in v2.0 (redwoodjs#6059)
  docs(tutorial): Adds more TS hints in the toturial (redwoodjs#6115)
  Revert auth provider refactor (redwoodjs#6135)
dac09 added a commit to dac09/redwood that referenced this pull request Aug 10, 2022
…-types-on-setup-auth

* 'main' of github.com:redwoodjs/redwood: (33 commits)
  fix(generators): Dont set tests=false in sdl generators by default (redwoodjs#6195)
  Harmonize optional chaining across all `hasRole` flavors & reduce duplication, avoiding errors on empty currentUser (redwoodjs#6159)
  Amend import order in auth templates according to ESLint rules introduced in v2.0 (redwoodjs#6059)
  docs(tutorial): Adds more TS hints in the toturial (redwoodjs#6115)
  Revert auth provider refactor (redwoodjs#6135)
  fix(deps): update docusaurus monorepo to v2.0.1 (redwoodjs#6176)
  fix(deps): update typescript-eslint monorepo to v5.33.0 (redwoodjs#6192)
  fix(deps): update dependency yargs-parser to v21.1.1 (redwoodjs#6191)
  fix(deps): update dependency fastify to v4.4.0 (redwoodjs#6190)
  fix(deps): update dependency @testing-library/user-event to v14.4.2 (redwoodjs#6189)
  chore(deps): update dependency @types/vscode to v1.70.0 (redwoodjs#6188)
  chore(deps): update dependency @types/prettier to v2.7.0 (redwoodjs#6187)
  fix(deps): update dependency systeminformation to v5.12.4 (redwoodjs#6186)
  chore(deps): update dependency @clerk/types to v2.21.0 (redwoodjs#6179)
  chore(deps): update dependency lerna to v5.4.0 (redwoodjs#6180)
  fix(deps): update prisma monorepo to v4.1.1 (redwoodjs#6181)
  chore(deps): update dependency @clerk/clerk-js to v3.17.0 (redwoodjs#6178)
  fix(deps): update storybook monorepo to v6.5.10 (redwoodjs#6177)
  fix(deps): update dependency @actions/core to v1.9.1 (redwoodjs#6175)
  chore(deps): update dependency magic-sdk to v9 (redwoodjs#6138)
  ...
@Tobbe Tobbe mentioned this pull request Aug 16, 2022
@jtoar jtoar modified the milestones: next-release, v3.0.0 Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixture-ok Override the test project fixture check release:fix This PR is a fix topic/crwa create-redwood-app
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants