Skip to content
Snippets Groups Projects

WIP: Introduce new artifact subcommand `delete`

Closed James Ennis requested to merge jennis/new_artifact_subcommands into master
1 unresolved thread

Description

This MR aims to introduce the a new bst artifact delete subcommand.

The addition of the artifact delete subcommand itself has been split out from !1008 (closed). This MR adds tests to the command and further ensures that the command can handle more use-cases.

Acceptance criteria

  1. Cherry-pick relevant commits of !1008 (closed)
  2. Handle deleting non-existent/non-present refs more gracefully
  3. Don't touch cascache.py API
  4. Ensure that we can delete artifacts that have been pulled without their buildtree
  5. Add tests for the extra use-cases

This MR will close #477 (closed) and partially address #773 (closed)

UPDATE: This MR is now on hold due to a decision to ensure that artifact refs are handled properly Stream.py, instead of including such logic in _frontend/cli.py.

Edited by James Ennis

Merge request reports

Pipeline #43723407 passed

Pipeline passed for b8aea71b on jennis/new_artifact_subcommands

Test coverage 86.02% from 1 job

Closed by James EnnisJames Ennis 6 years ago (Mar 18, 2019 9:50am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I don't think it's necessary to include the commit to split the helper up here. bst artifact delete deletes artifacts and elements, the purpose of splitting up the helper was for commands which should only operate on elements, like bst artifact list.

  • richardmaw-codethink
    richardmaw-codethink @richardmaw-codethink started a thread on an outdated change in commit e0ace830
  • 869 869 if tree.hash in reachable:
    870 870 return
    871 871
    872 if not os.path.exists(self.objpath(tree)):
    873 return
    874
    872 875 if update_mtime:
    873 876 os.utime(self.objpath(tree))
  • James Ennis marked as a Work In Progress

    marked as a Work In Progress

  • James Ennis changed the description

    changed the description

  • James Ennis added 78 commits

    added 78 commits

    • e0ace830...ce91ce5d - 70 commits from branch master
    • ab6740f9 - cli: Add artifact delete subcommand
    • e992e41c - artifactcache.py: Add prune() method to ArtifactCache
    • 1050e97c - cli.py: Defer pruning until all specified refs are removed
    • cc2f2957 - tests: Add new tests for bst artifact delete
    • 38a09bf3 - artifactcache.py: API Cleanup - Add contains_ref() method
    • 0ca62cf4 - cli.py: Print to stderr when trying to delete an uncached artifact
    • 0bdb5c11 - cli.py: Ensure that both 'weak' and 'strong' artifacts are deleted
    • b8aea71b - cascache.py: Ensure path exists before trying to update the mtime

    Compare with previous version

  • mentioned in issue #773 (closed)

  • Author Developer

    Resolved by ac71ea61

  • closed

  • Please register or sign in to reply
    Loading