Skip to content

fix: Course correct on project update consistency - #2423

Merged
helderco merged 1 commit into
dagger:mainfrom
helderco:project-update
May 12, 2022
Merged

helderco merged 1 commit into
dagger:mainfrom
helderco:project-update

Conversation

@helderco

Copy link
Copy Markdown
Contributor

Fixes #2413

Overview

I've been assuming that:

  1. dagger project update installs both built-in and external packages
  2. When installing an external package that's already in dagger.sum the checksum is being checked

It's how I think it should work and both turned out be wrong, as I've realized in:

Before

  • dagger project update
    • Copies built-ins from binary to cue.mod/pkg
    • Does not install external packages
  • dagger project update -u
    • unreachable code
  • checksum not being checked when installing a package with a version that matches dagger.mod

After

  • Install both built-in and external packages in dagger project update
  • Recover dagger project update -u which updates all packages in dagger.mod to latest versions
  • Verify checksum
  • Better reporting (info log) on what's being done

Signed-off-by: Helder Correia

@helderco
helderco requested review from a team, aluzzardi, samalba and shykes as code owners May 10, 2022 16:15
@shykes

shykes commented May 10, 2022

Copy link
Copy Markdown
Contributor

Nice to see improvements on the package management side :)

How do you know which external packages to update? Do you scan the list in the sum file, or scan imports in the plan? I'm assuming the former, but one can dream :)

@helderco

Copy link
Copy Markdown
Contributor Author

Haha, not yet scanning imports 🙂 It's by reading dagger.mod file.

@shykes

shykes commented May 10, 2022

Copy link
Copy Markdown
Contributor

Haha, not yet scanning imports 🙂 It's by reading dagger.mod file.

I had to ask :) By the way, I implemented a cue import scanner a long time ago, and the API was quite simple. It may have changed, and I may have missed complicated edge cases... But it's worth taking a look, I bet implementing it will be easier than everyone thinks.

@helderco

Copy link
Copy Markdown
Contributor Author

it's worth taking a look, I bet implementing it will be easier than everyone thinks.

Ah cool! I'll take a look 🙂

@helderco helderco added the area/cli All about go code on dagger CLI label May 10, 2022
@helderco
helderco merged commit ed9255e into dagger:main May 12, 2022
@helderco
helderco deleted the project-update branch May 12, 2022 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli All about go code on dagger CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure project update is handling built-ins and external dependencies

4 participants