Skip to content

Add timestamp-based package filtering (exclude-newer / exclude-older)#151

Draft
pavelzw with Copilot wants to merge 3 commits into
mainfrom
copilot/add-timestamp-based-threshold
Draft

Add timestamp-based package filtering (exclude-newer / exclude-older)#151
pavelzw with Copilot wants to merge 3 commits into
mainfrom
copilot/add-timestamp-based-threshold

Conversation

Copilot AI commented Mar 27, 2026

Copy link
Copy Markdown

Adds support for filtering mirrored packages by build timestamp, enabling use cases like "mirror only packages built after 2023".

Changes

  • PackageFilter replaces MatchSpecWrapper — extends MatchSpec with optional exclude-newer / exclude-older timestamp bounds. Both plain-string and object YAML forms are supported and can be freely mixed.
  • parse_datetime — accepts RFC 3339 (2025-01-01T00:00:00Z), date-only (2025-01-01 → midnight UTC), and relative durations (90d = 90 days ago).
  • MirrorMode variants updated to carry Vec<PackageFilter> instead of Vec<MatchSpec>.
  • get_packages_to_mirror — delegates to PackageFilter::matches(). Also fixes a pre-existing logic bug in IncludeExclude where packages matching an include override were still being excluded when an exclude list was present.
  • Packages with no timestamp field always pass the bounds check (include-unknown).
  • 13 unit tests added for datetime parsing, deserialization, and matching logic.

Example config

include:
  - "jupyter*[license=MIT]"             # unchanged plain-string form

  - matchspec: "python*"
    exclude-newer: "2025-10-01T00:00:00Z"
    exclude-older: "2023-01-01"

  - matchspec: "numpy*"
    exclude-older: "90d"                 # relative: only packages from last 90 days

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI linked an issue Mar 27, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add timestamp based threshold support for package mirroring Add timestamp-based package filtering (exclude-newer / exclude-older) Mar 27, 2026
Copilot AI requested a review from pavelzw March 27, 2026 18:03
@github-actions

github-actions Bot commented Mar 28, 2026

Copy link
Copy Markdown

Thank you for opening this pull request! 👋🏼

This repository requires pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details
No release type found in pull request title "Add timestamp-based package filtering (exclude-newer / exclude-older)". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@pavelzw

pavelzw commented Apr 2, 2026

Copy link
Copy Markdown
Member

@copilot fix CI

Copilot AI commented Apr 2, 2026

Copy link
Copy Markdown
Author

@copilot fix CI

Fixed in c18f9a9. The CI failures were:

  1. Clippy collapsible_if — three nested if let blocks were collapsed into if let ... && ... chains.
  2. rustfmt — import ordering in config.rs and lib.rs was reordered to match rustfmt's expectations.

@justacec

Copy link
Copy Markdown

Was all off the code for this PR just vibe coded?

Not used to seeing a bunch of copilot messages with no human interactions.

@pavelzw

pavelzw commented May 30, 2026

Copy link
Copy Markdown
Member

Yes I tried it out back then with semi success. Feel free to pick this thing up or start from scratch if you want :)

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.

timestamp based threshold

3 participants