Skip to content

Add Zeno get list command for archiving URLs from files#514

Merged
NGTmeaty merged 4 commits into
mainfrom
copilot/add-archive-command-list
Nov 5, 2025
Merged

Add Zeno get list command for archiving URLs from files#514
NGTmeaty merged 4 commits into
mainfrom
copilot/add-archive-command-list

Conversation

Copilot AI commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Implementing Zeno get list command to archive URLs from a file

Summary

Successfully implemented the Zeno get list command that allows archiving URLs from text file(s).

Features

  • ✅ Read URLs from local files
  • ✅ Support remote files (http/https URLs)
  • ✅ Handle multiple files in a single command
  • ✅ Ignore empty lines and comments (lines starting with #)
  • ✅ Proper error handling for missing files and empty lists
  • ✅ Consistent with existing command patterns (get url, get hq)
  • ✅ Default user agent set for remote downloads

Testing

  • ✅ E2E test added and passing (checks multiple URLs)
  • ✅ Manual testing with local files
  • ✅ Manual testing with multiple files
  • ✅ Manual testing with comments and empty lines
  • ✅ Code review completed and feedback addressed
  • ✅ Security checks passed (CodeQL: 0 alerts)

Recent Changes

Addressed PR review feedback:

  • Added missing urls.txt test file with multiple URLs
  • Updated command Usage to show [FILE|URL...]
  • Set default user agent for remote file downloads
  • Enhanced test to verify all specific URLs are archived

Usage

# Archive URLs from a single file
./Zeno get list urls.txt --workers 1

# Archive URLs from multiple files
./Zeno get list list1.txt list2.txt --workers 2

# Archive URLs from a remote file
./Zeno get list https://example.com/urls.txt --workers 1
Original prompt

This section details on the original issue you should resolve

<issue_title>Add command to archive based on a list</issue_title>
<issue_description>- [ ] Archive based on a list (similar to the old get list functionality)

<agent_instructions>We want to add a new command that lets us archive based on a text file (with a list of URLs). This should be added as Zeno get list. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 31, 2025 00:20
- Created get_list.go with support for local and remote files
- Added helper functions to read URLs from files (supporting comments and empty lines)
- Registered list command in get.go
- Added e2e test for the list command
- Updated e2e package with helper functions for list command testing

Co-authored-by: NGTmeaty <2244519+NGTmeaty@users.noreply.github.com>
The MinimumNArgs(1) already ensures at least one argument is provided

Co-authored-by: NGTmeaty <2244519+NGTmeaty@users.noreply.github.com>
Copilot AI changed the title [WIP] Add command to archive based on a list Add Zeno get list command for archiving URLs from files Oct 31, 2025
Copilot AI requested a review from NGTmeaty October 31, 2025 00:28

@NGTmeaty NGTmeaty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread e2e/test/getlist/getlist_test.go
Comment thread cmd/get_list.go Outdated
Comment thread cmd/get_list.go Outdated
Comment thread e2e/test/getlist/getlist_test.go
- Add missing urls.txt test file with multiple URLs
- Update command Use field to specify FILE|URL
- Set default user agent for remote file downloads
- Enhance test to verify all URLs from list are archived

Co-authored-by: NGTmeaty <2244519+NGTmeaty@users.noreply.github.com>
Copilot AI requested a review from NGTmeaty October 31, 2025 00:56
@codecov-commenter

codecov-commenter commented Oct 31, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.11111% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.42%. Comparing base (2abbcd3) to head (6b48e9c).

Files with missing lines Patch % Lines
cmd/get_list.go 31.94% 39 Missing and 10 partials ⚠️
e2e/e2e.go 76.47% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
- Coverage   56.61%   56.42%   -0.19%     
==========================================
  Files         130      131       +1     
  Lines        6481     6570      +89     
==========================================
+ Hits         3669     3707      +38     
- Misses       2448     2488      +40     
- Partials      364      375      +11     
Flag Coverage Δ
e2etests 41.98% <41.11%> (+0.70%) ⬆️
unittests 28.81% <0.00%> (-0.34%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NGTmeaty NGTmeaty marked this pull request as ready for review October 31, 2025 18:00

@NGTmeaty NGTmeaty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code looks good and tests are passing. I have tested locally and it works correctly.

Comment thread cmd/get_list.go
if userAgent == "" {
userAgent = "Mozilla/5.0 (compatible; Zeno)"
}
req.Header.Set("User-Agent", userAgent)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The UA string should be generated to match whatever Zeno would generate by default. Okay to fix in a separate issue.

Comment thread cmd/get_list.go
Comment on lines +138 to +146
// Read file line by line
scanner := bufio.NewScanner(resp.Body)
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
if line == "" || strings.HasPrefix(line, "#") {
continue
}
urls = append(urls, line)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This code chunk appears twice (also on lines 97-104), should we refactor into it's own function?

Comment thread e2e/test/getlist/getlist_test.go

@willmhowes willmhowes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, so long as separate issues are made where noted

@NGTmeaty NGTmeaty merged commit 73c7dde into main Nov 5, 2025
7 of 8 checks passed
@NGTmeaty NGTmeaty deleted the copilot/add-archive-command-list branch November 5, 2025 01:58
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.

Add command to archive based on a list

4 participants