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

Add v1.1 migration guide #1272

Merged
merged 9 commits into from
Mar 30, 2022
Merged

Add v1.1 migration guide #1272

merged 9 commits into from
Mar 30, 2022

Conversation

jtcohen6
Copy link
Collaborator

@jtcohen6 jtcohen6 commented Mar 26, 2022

resolves #1260

Let's merge this PR, before all other v1.1 updates, since those PRs should update the migration guide.

Description & motivation

In separate commits, should we want to split any of these off into their own PRs:

  • Add v1.1 to version dropdown
  • Add "isPrerelease" to VersionContext, and show a warning banner if a user has selected a prerelease version from the dropdown (@JKarlavige would love your eyes on this!)
  • Add v1.1 migration guide, with one initial change
  • Try using versionedPages to show v1.1 migration guide only when v1.1 selected in dropdown (and warn otherwise). This doesn't seem to work as I'd expect, but I'm also not sure it even makes sense for a page like this—we probably do want to show all version guides to all users, no matter which version they're using right now.
  • Rename v1.0 migration guide, to follow same Major.Minor naming format (with sidebar update + redirect)

Pre-release docs

Is this change related to an unreleased version of dbt?

  • Yes: please
    • update the base branch to next
    • add Changelog components: <Changelog>[New/Changed] in v0.x.0</Changelog>
    • add links to the "New and changed documentation" section of the latest Migration Guide
  • No: please ensure the base branch is current
  • Unsure: we'll let you know!

Yes! Let's change the way we do this: #1261

Checklist

If you added new pages (delete if not applicable):

  • The page has been added to website/sidebars.js
  • The new page has a unique filename

If you removed existing pages (delete if not applicable):

  • The page has been removed from website/sidebars.js
  • An entry has been added to _redirects

@netlify
Copy link

netlify bot commented Mar 26, 2022

Deploy Preview for docs-getdbt-com ready!

Name Link
🔨 Latest commit df6835f
🔍 Latest deploy log https://app.netlify.com/sites/docs-getdbt-com/deploys/62442404ab231a0008d08764
😎 Deploy Preview https://deploy-preview-1272--docs-getdbt-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Collaborator

@JKarlavige JKarlavige 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 awesome @jtcohen6, nice work! Added one requested change for the useEffect in the DocPage file. Once that is adjusted i'd call this good to go.

Comment on lines 62 to 75
useEffect(() => {
// If version is not isPrerelease, do not show banner
if(!isPrerelease) {
setPreData({
showisPrereleaseBanner: false,
isPrereleaseBannerText: ''
})
} else {
setPreData({
showisPrereleaseBanner: true,
isPrereleaseBannerText: `This is a prerelease version. The latest stable version is ${latestStableRelease}`
})
}
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

For this useEffect, it looks like this is causing a Maximum update depth exceeded error, due to not having a dependency array.

There's two options to resolve this from what I see. You can either:

  • Add the dependency array to the end of this useEffect, making line 75 }, [dbtVersion])
  • Or, move the if/else statement from this useEffect, into the useEffect below which uses the same [dbtVersion] dependency array

This should prevent the useEffect from getting stuck in a constant loop, and only firing when the version has changed.

image

Copy link
Collaborator Author

@jtcohen6 jtcohen6 Mar 29, 2022

Choose a reason for hiding this comment

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

@JKarlavige Ah, so that's what }, [dbtVersion]) is doing! There's a reason you're the one who gets to do this stuff for real ;)

Thanks for the quick pointer. I like option 2, since that keeps the logic a bit more consolidated. We shouldn't ever have a version that's both a prerelease and within 3 months of EOL.

Copy link
Collaborator

@JKarlavige JKarlavige left a comment

Choose a reason for hiding this comment

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

Verified the depth error is no longer occurring, all looks good to me!

} else {
setPreData({
showisPrereleaseBanner: true,
isPrereleaseBannerText : `This is a prerelease version. The latest stable version is ${latestStableRelease}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

@JKarlavige or @jtcohen6 How can we programmatically add the prerelease version here?

Suggested change
isPrereleaseBannerText : `This is a prerelease version. The latest stable version is ${latestStableRelease}`
isPrereleaseBannerText : `You are currently viewing v1.1, which is a prerelease of dbt Core. The latest stable version is ${latestStableRelease}`

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@runleonarun I think I can do this! comma ça ?

Screenshot 2022-03-29 at 20 38 01

@jtcohen6
Copy link
Collaborator Author

Thanks for the feedback both! I'm going to merge this in, in order to

  • unblock other v1.1 PRs
  • have a "v1.1 landing page" to start linking to from elsewhere

@jtcohen6 jtcohen6 merged commit e3deb01 into current Mar 30, 2022
@jtcohen6 jtcohen6 deleted the feat/v1.1-guide branch March 30, 2022 09:43
@jtcohen6
Copy link
Collaborator Author

Caught one quick thing I needed to fix after merging: ebd0003

@JKarlavige
Copy link
Collaborator

Looks great, nice work 👍

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.

Add v1.1, initialize migration guide
3 participants