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 spk export failing if builds are missing #800

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

jrray
Copy link
Collaborator

@jrray jrray commented Jul 18, 2023

In our origin repo there are some traces of a package that may have been partually published, where there are "spec build" tags but no "pkg build" tags, as in:

spfs/tags/spk/spec/pkg-name/1.0.0/6XFZP6SR.tag (exists)
spfs/tags/spk/pkg/pkg-name (does not exist)

A new build of this package failed to spk export due to these remnants found in the origin repo:

 INFO exporting pkg=pkg-name/1.0.0
 INFO exporting pkg=pkg-name/1.0.0/src
 INFO exporting pkg=pkg-name/1.0.0/5MDZ2ADM
 WARN Ensure that you are specifying at least a package and
 WARN version number when exporting from the local repository
ERROR Package not found: pkg-name/1.0.0/6XFZP6SR

This commit takes a minimally invasive approach of ignoring PackageNotFoundError when these are generated about specific builds, as in builds that exist as far as list_package_builds is concerned, but fail to be loaded. It will still hard error if one attempts to export a specific build that does not exist.

We don't think that we should have to manually remove the "spec build" tags from our origin repo in order for spk export to work.

In our origin repo there are some traces of a package that may have been
partually published, where there are "spec build" tags but no "pkg build"
tags, as in:

    spfs/tags/spk/spec/pkg-name/1.0.0/6XFZP6SR.tag (exists)
    spfs/tags/spk/pkg/pkg-name (does not exist)

A _new_ build of this package failed to `spk export` due to these remnants
found in the origin repo:

     INFO exporting pkg=pkg-name/1.0.0
     INFO exporting pkg=pkg-name/1.0.0/src
     INFO exporting pkg=pkg-name/1.0.0/5MDZ2ADM
     WARN Ensure that you are specifying at least a package and
     WARN version number when exporting from the local repository
    ERROR Package not found: pkg-name/1.0.0/6XFZP6SR

This commit takes a minimally invasive approach of ignoring
PackageNotFoundError when these are generated about specific builds, as in
builds that exist as far as `list_package_builds` is concerned, but fail to
be loaded. It will still hard error if one attempts to export a specific
build that does not exist.

We don't think that we should have to manually remove the "spec build" tags
from our origin repo in order for `spk export` to work.

Signed-off-by: J Robert Ray <jrray@imageworks.com>
@jrray jrray added the bug Something isn't working label Jul 18, 2023
@jrray jrray self-assigned this Jul 18, 2023
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #800 (0b70e6a) into main (c9ffa9a) will increase coverage by 0.10%.
The diff coverage is 45.71%.

@@            Coverage Diff             @@
##             main     #800      +/-   ##
==========================================
+ Coverage   53.87%   53.98%   +0.10%     
==========================================
  Files         248      248              
  Lines       19284    19303      +19     
==========================================
+ Hits        10389    10420      +31     
+ Misses       8895     8883      -12     
Impacted Files Coverage Δ
crates/spk-cli/group3/src/cmd_export.rs 0.00% <ø> (ø)
crates/spk-storage/src/storage/archive.rs 68.86% <45.71%> (+13.69%) ⬆️

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jrray jrray merged commit 9ca9d6e into main Jul 19, 2023
5 of 6 checks passed
@jrray jrray deleted the export-ignore-missing-builds branch July 19, 2023 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants