Skip to content

shared-opt-dir/agency-parser/archive.sh doesn't remove old schedule entirely in the past when current one available #534

@mmathieum

Description

@mmathieum

Because it iterates over archives by [A-Z0-9] order, old archive are checked 1st so they are kept even if newer one is available.

Example:

Archives:

  • archive/20250903-20251212.zip
  • archive/20251118-20260327.zip

Result:

> Yesterday: '20260128'
- archive dir: './archive'
--------------------
- archive: ./archive/20250903-20251212.zip
- archive start date: '20250903'
- archive end date: '20251212'
- archive is entirely in the past & older than previous one > KEEP as CURRENT
--------------------
--------------------
- archive: ./archive/20251118-20260327.zip
- archive start date: '20251118'
- archive end date: '20260327'
- archive starts before 20260128 and ends after > KEEP as CURRENT
--------------------

Expected:

> Yesterday: '20260128'
- archive dir: './archive'
--------------------
- archive: ./archive/20251118-20260327.zip
- archive start date: '20251118'
- archive end date: '20260327'
- archive starts before 20260128 and ends after > KEEP as CURRENT
--------------------
--------------------
- archive: ./archive/20250903-20251212.zip
- archive start date: '20250903'
- archive end date: '20251212'
- archive is entirely in the past & older than new one > REMOVE
--------------------

Metadata

Metadata

Labels

AIMade by/with AI (Gemini/Copilot)shell

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions