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

Fix version orders #6057

Merged
merged 37 commits into from
Sep 17, 2024
Merged

Fix version orders #6057

merged 37 commits into from
Sep 17, 2024

Conversation

JKarlavige
Copy link
Collaborator

@JKarlavige JKarlavige commented Sep 12, 2024

What are you changing in this pull request and why?

Issue

With the current versioning, v1.10 is considered less than v1.9. This adjusts the versioning to correctly sort the version numbers by major, minor and patch versions.

Preview

Verify the VersionBlock components correctly show/hide based on the firstVersion & lastVersion props set:
https://docs-getdbt-com-git-fix-version-orders-dbt-labs.vercel.app/docs/version-testing

Verify this page hides from the sidebar for versions after v1.8:
https://docs-getdbt-com-git-fix-version-orders-dbt-labs.vercel.app/reference/resource-configs/target_database

Verify Project configs sidebar category is only visible for v1.8 and up:
https://docs-getdbt-com-git-fix-version-orders-dbt-labs.vercel.app/reference/dbt_project.yml

To quickly test the new sortVersions method, drop the following code into the versionBlock file and visit the /version-testing page above. There is a console.log within sortVersions which will show the sorted array of versions.

sortVersions([
  "1.11",
  "1.7",
  "2.1",
  "1.8",
  "1.6",
  "2.2.1",
  "1.10",
  "2.0.1",
  "1.9",
  "1.9.1",
  "1.10.1",
  "2.0",
]);

TODO Before Merge

  • Delete demo version-testing page
  • Remove console.log from sortedVersions
  • Revert versions in dbt-versions
  • Remove demo Project configs versioned category in dbt-versions

Copy link

vercel bot commented Sep 12, 2024

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

Name Status Preview Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview Sep 17, 2024 2:25pm

@github-actions github-actions bot added content Improvements or additions to content size: medium This change will take up to a week to address labels Sep 12, 2024
@github-actions github-actions bot added size: large This change will more than a week to address and might require more than one person and removed size: medium This change will take up to a week to address labels Sep 12, 2024
Copy link
Collaborator Author

@JKarlavige JKarlavige Sep 12, 2024

Choose a reason for hiding this comment

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

Functionality not used, confirmed with Docs team we can remove the Var component: https://dbt-labs.slack.com/archives/C02NCQ9483C/p1726157412409069

Comment on lines 58 to 62
"page": "reference/resource-configs/target_database",
"lastVersion": "1.8",
},
{
"page": "/reference/resource-configs/target_schema",
"page": "reference/resource-configs/target_schema",
Copy link
Collaborator Author

@JKarlavige JKarlavige Sep 12, 2024

Choose a reason for hiding this comment

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

Keep these changes, page paths should not have leading forward slash. Remove all other changes in this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Delete this page before merge

return 0
});

console.log('sortedVersions', sortedVersions)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove this console before merge

@JKarlavige JKarlavige marked this pull request as ready for review September 12, 2024 18:36
@JKarlavige JKarlavige requested a review from a team as a code owner September 12, 2024 18:36
@john-rock
Copy link
Contributor

Hey @JKarlavige nice work on this, qq on this page https://docs-getdbt-com-git-fix-version-orders-dbt-labs.vercel.app/reference/resource-configs/target_database

Confirmed it does get hidden from the sidebar after v1.8 but is this the correct copy that is suppose to be showing if the page is accessed when the version is set > v1.8?
image

Specifically the "You should upgrade to 0 or later if you want to use this feature."

@JKarlavige
Copy link
Collaborator Author

Hey @JKarlavige nice work on this, qq on this page https://docs-getdbt-com-git-fix-version-orders-dbt-labs.vercel.app/reference/resource-configs/target_database

Confirmed it does get hidden from the sidebar after v1.8 but is this the correct copy that is suppose to be showing if the page is accessed when the version is set > v1.8? image

Specifically the "You should upgrade to 0 or later if you want to use this feature."

Nice catch, it should definitely not say that. Will work on fixing that!

mirnawong1 and others added 20 commits September 16, 2024 10:11
Adds a reference to `{{ target.schema }}`, useful when defining `foreign_key` constraints.
## What are you changing in this pull request and why?

Reorganized the Advanced CI docs  

## Checklist
- [x] I have reviewed the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [x] The topic I'm writing about is for specific dbt version(s) and I
have versioned it according to the [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and/or [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content)
guidelines.
- [x] Needs PM review
- [x] Needs Legal review

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: nataliefiann <[email protected]>
## What are you changing in this pull request and why?

Fix card on landing page

## Checklist
- [x] I have reviewed the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [x] The topic I'm writing about is for specific dbt version(s) and I
have versioned it according to the [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and/or [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content)
guidelines.
dbt-core 1.8.3 release
## What are you changing in this pull request and why?

* Updating to our own dbt maintained repo.

Note that Leah will update the videos next week.

## Checklist
- [ ] I have reviewed the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [ ] The topic I'm writing about is for specific dbt version(s) and I
have versioned it according to the [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and/or [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content)
guidelines.
- [ ] I have added checklist item(s) to this list for anything anything
that needs to happen before this PR is merged, such as "needs technical
review" or "change base branch."
<!--
PRE-RELEASE VERSION OF dbt (if so, uncomment):
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/docs/dbt-versions/core-upgrade)
-->
<!-- 
ADDING OR REMOVING PAGES (if so, uncomment):
- [ ] Add/remove page in `website/sidebars.js`
- [ ] Provide a unique filename for new pages
- [ ] Add an entry for deleted pages in `website/vercel.json`
- [ ] Run link testing locally with `npm run build` to update the links
that point to deleted pages
-->
@JKarlavige
Copy link
Collaborator Author

@john-rock Updated the version warning banner to exclude the "first available in version.." part of the message if a firstVersion prop isn't set for that versioned page. Previews below:

Verify version banner no longer shows incorrect upgrade recommendation line:
https://docs-getdbt-com-git-fix-version-orders-dbt-labs.vercel.app/reference/resource-configs/target_database

Select v1.7 or lower and verify version banner shows with correct message:
https://docs-getdbt-com-git-fix-version-orders-dbt-labs.vercel.app/reference/global-configs/indirect-selection

Verify all pages not listed in versionedPages array do not show version warning banner:
https://docs-getdbt-com-git-fix-version-orders-dbt-labs.vercel.app/docs/introduction

Copy link
Contributor

@john-rock john-rock left a comment

Choose a reason for hiding this comment

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

This lgtm. I'm no longer seeing the incorrect warning message if firstVersion is not set.

Comment on lines +20 to +25
const aMajor = aSegments[0] || "0"
const bMajor = bSegments[0] || "0"
const aMinor = aSegments[1] || "0"
const bMinor = bSegments[1] || "0"
const aPatch = aSegments[2] || "0"
const bPatch = bSegments[2] || "0"
Copy link
Contributor

Choose a reason for hiding this comment

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

The lengths we go to with javascript 🤣 nice work on this util.

@JKarlavige JKarlavige merged commit 6c6a81a into current Sep 17, 2024
6 checks passed
@JKarlavige JKarlavige deleted the fix-version-orders branch September 17, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content size: large This change will more than a week to address and might require more than one person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants