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

Fixups for deps lock file #9147

Merged
merged 7 commits into from
Nov 28, 2023
Merged

Fixups for deps lock file #9147

merged 7 commits into from
Nov 28, 2023

Conversation

jtcohen6
Copy link
Contributor

resolves #9050
resolves #9127

Problem

Solution

  • Overwrite git package revision with actual git commit SHA
  • Switch to using PackageRenderer for rereading package-lock.json, plus plumbing & tests to support.

During live pairing with @ChenyuLInx @MichelleArk last Wednesday, we added some defensive code (to support backporting) and an extra logging event (as a treat).

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

1 similar comment
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (9bb970e) 86.66% compared to head (c0efd79) 86.60%.
Report is 1 commits behind head on main.

Files Patch % Lines
core/dbt/deps/tarball.py 85.71% 2 Missing ⚠️
core/dbt/deps/git.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9147      +/-   ##
==========================================
- Coverage   86.66%   86.60%   -0.07%     
==========================================
  Files         179      179              
  Lines       26569    26598      +29     
==========================================
+ Hits        23027    23036       +9     
- Misses       3542     3562      +20     
Flag Coverage Δ
integration 83.44% <86.66%> (-0.16%) ⬇️
unit 65.01% <80.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

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

Thanks!!!

)

@mock.patch("dbt.deps.tarball.get_downloads_path")
def test_tarball_pinned_package_contract_with_unrendered(self, mock_get_downloads_path):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice unittest!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(ty michelle!)

@jtcohen6 jtcohen6 merged commit 32fde75 into main Nov 28, 2023
51 checks passed
@jtcohen6 jtcohen6 deleted the jerco/deps-lock-fixups branch November 28, 2023 09:06
Copy link
Contributor

The backport to 1.7.latest failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.7.latest 1.7.latest
# Navigate to the new working tree
cd .worktrees/backport-1.7.latest
# Create a new branch
git switch --create backport-9147-to-1.7.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 32fde755043134dd8a2f5835db9c50e2f4383cb8
# Push it to GitHub
git push --set-upstream origin backport-9147-to-1.7.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.7.latest

Then, create a pull request where the base branch is 1.7.latest and the compare/head branch is backport-9147-to-1.7.latest.

jtcohen6 added a commit that referenced this pull request Nov 29, 2023
* Fixups for deps lock file (#9147)

* Update git revision with commit SHA

* Use PackageRenderer for lock file

* add unit tests for git and tarball packages

* deepcopy unrendered_packages_data before iteration, fix remaining tests

* Add functional tests

* Add changelog entries

* Assert one more

---------

Co-authored-by: Michelle Ark <[email protected]>

* Restore warning on unpinned git packages

---------

Co-authored-by: Michelle Ark <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants