Skip to content

Issue #246, list --deprecated, implemented#731

Open
bgn42 wants to merge 6 commits intomainfrom
issue-246
Open

Issue #246, list --deprecated, implemented#731
bgn42 wants to merge 6 commits intomainfrom
issue-246

Conversation

@bgn42
Copy link
Copy Markdown
Contributor

@bgn42 bgn42 commented Mar 30, 2026

Fixes

fix #246

Changes

  • deprecated option for list command
  • update-index does not download deprecated pdsc files
  • filter deprecated PDSC tags upfront in DownloadPDSCFiles so encoded progress reporting accurately reflects the actual number of downloads
  • compute IsDeprecated() once per entry in the list --public loop to avoid redundant date parsing
  • updated DownloadPDSCFiles doc comment to document the skipDeprecatedPdscFiles parameter

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@qltysh
Copy link
Copy Markdown

qltysh bot commented Mar 30, 2026

Qlty

Coverage Impact

⬆️ Merging this pull request will increase total coverage on main by 0.16%.

Modified Files with Diff Coverage (6)

RatingFile% DiffUncovered Line #s
Coverage rating: C Coverage rating: C
cmd/xml/pidx.go94.7%144
Coverage rating: D Coverage rating: D
cmd/installer/root.go90.3%701-703
Coverage rating: B Coverage rating: B
cmd/commands/init.go100.0%
Coverage rating: B Coverage rating: C
cmd/commands/list.go50.0%37-38, 50
Coverage rating: C Coverage rating: C
cmd/commands/root.go100.0%
Coverage rating: B Coverage rating: B
cmd/commands/update_index.go100.0%
Total88.1%
🤖 Increase coverage with AI coding...

In the `issue-246` branch, add test coverage for this new code:

- `cmd/commands/list.go` -- Lines 37-38 and 50
- `cmd/installer/root.go` -- Line 701-703
- `cmd/xml/pidx.go` -- Line 144

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

Test Results

    4 files  ± 0     24 suites  ±0   1m 6s ⏱️ +2s
  800 tests +10    800 ✅ +10  0 💤 ±0  0 ❌ ±0 
3 183 runs  +40  3 183 ✅ +40  0 💤 ±0  0 ❌ ±0 

Results for commit 04d2876. ± Comparison against base commit d9c5f44.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements support for deprecated packs by (1) adding a --deprecated option to the list command and (2) skipping downloads of deprecated PDSC files during init/update-index workflows.

Changes:

  • Added PdscTag.IsDeprecated() plus unit tests to interpret the deprecated="YYYY-MM-DD" attribute.
  • Updated public-index download flows to optionally skip deprecated PDSC files, with installer test coverage.
  • Added list --deprecated/-d to show only deprecated packs from the public index (and hide deprecated packs by default in --public listing), plus updated design docs.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cmd/xml/pidx.go Adds PdscTag.IsDeprecated() to evaluate deprecation based on a date string.
cmd/xml/pidx_test.go Adds unit tests for IsDeprecated() date handling.
cmd/installer/root.go Threads “skip deprecated” through index update / PDSC download paths; hides deprecated packs by default in public listing.
cmd/installer/root_test.go Extends UpdatePublicIndex tests and adds coverage for skipping deprecated PDSCs during mass download.
cmd/installer/root_pack_list_test.go Adds tests asserting deprecated packs are hidden/shown appropriately in list --public output.
cmd/commands/list.go Introduces --deprecated/-d flag and wires it into ListInstalledPacks.
cmd/commands/update_index.go Passes the new “skip deprecated” argument into UpdatePublicIndex for update-index behavior.
cmd/commands/init.go Enables skipping deprecated PDSCs for init flows.
cmd/commands/root.go Updates automatic index refresh call to include the new argument.
DESIGN.md Documents new list behavior and skipping deprecated PDSC downloads.
Comments suppressed due to low confidence (1)

cmd/installer/root.go:993

  • skipDeprecatedPdscFiles is currently only applied to DownloadPDSCFiles. When sparse is false, UpdatePublicIndex can still download updated PDSC files via UpdateInstalledPDSCFiles (e.g., for deprecated packs already present in the cache index). If the intent is that update-index/init -a ignore deprecated <pdsc> entries entirely, consider propagating skipDeprecatedPdscFiles into the update path as well and filtering deprecated tags there too.
func UpdatePublicIndex(indexPath string, sparse, downloadPdsc, downloadRemainingPdscFiles, skipDeprecatedPdscFiles, updatePrivatePdsc, showInfo, insecureSkipVerify bool, concurrency int, timeout int) error {
	// For backwards compatibility, allow indexPath to be a file, but ideally it should be empty
	if indexPath == "" {
		indexPath = strings.TrimSuffix(Installation.PublicIndexXML.URL, "/") + "/" + PublicIndexName
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bgn42 bgn42 requested a review from jkrech March 30, 2026 22:37
@jkrech jkrech requested a review from brondani March 31, 2026 07:36
Copy link
Copy Markdown
Member

@jkrech jkrech left a comment

Choose a reason for hiding this comment

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

I have installed the CI build for windows and validated the behavior:

a) the additional option -d and --deprecated are listed in the usage for cpackget list -h
b) cpackget list lists installed packs
cpackget list --public lists public packs (.Web/index.pidx) + indicator for installed
cpackget list --deprecated lists public deprecated packs (.Web/index.pidx) + indicator for installed
if specifying --public and --deprecated at the same time - only deprecated packs are listed

c) cpackget update-index -all-pdsc-files has been changed to exclude pdsc files of deprecated public packs. The description of the usage/help text must be modified
d) Question: does uVision pack installer require cpackget to download all pdsc files including the deprecated packs? This option does not currently exist. The packinstaller has a selection button to display deprecated packs in addition.
This would require an option like cpackget update-index --all-pdsc-files --deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cpackget] exclude pdsc files from deprecated packs to be downloaded and present in the .Web folder

4 participants