Skip to content

feat: add 'exclude' input to filter versions#41

Draft
Koan-Bot wants to merge 1 commit into
perl-actions:mainfrom
atoomic:koan.atoomic/add-exclude-input
Draft

feat: add 'exclude' input to filter versions#41
Koan-Bot wants to merge 1 commit into
perl-actions:mainfrom
atoomic:koan.atoomic/add-exclude-input

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

What

Add an exclude input that accepts a comma-separated list of versions to remove from the output.

Why

Users currently need shell-based post-processing (jq filters) to remove specific versions from the matrix. This is a common need — e.g., skipping a known-broken Perl version on a specific platform.

How

  • perl_versions() accepts a new exclude string parameter
  • Versions are parsed via decode_version(), so 5.32, v5.32, and devel all work
  • Exclusion is applied before range filtering via a Set lookup
  • 8 new test cases cover single/multiple exclusions, devel, v-prefix, empty input, and edge cases

Testing

  • npm test — 71 tests pass (8 new for exclude)
  • npm run build — dist rebuilt

Comment thread perl-versions.js
}

function parse_exclude (exclude) {
if (!exclude) return [];

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.

  • function should also silently accept serialized json array
    • user may use chain of perl-versions call passing result of one as argument of another
  • consistency:
    • use function name parse_input_version_list
    • export it and call it same way as parse_input_version - before calling perl_versions

Follow-ups:

  • target can be element of list, for example: list of versions included in target A but not included in target B
  • include input parameter - when specified, versions are included into filtered list right before single-out is applied

Comment thread perl-versions.js
const excluded = new Set (parse_exclude (exclude).map ((v) => {
if (v === 'devel') return 'devel';
const decoded = decode_version (v);
return decoded ? `${decoded.major}.${decoded.minor}` : null;

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.

Note 1:
Useless L65, that is already done by decode_version.
In fact, maybe we should also move L63 in it.

Note 2:
Please move exclusion into separated function, so this function will in future look like:

versions = perl_versions_target  (target);
versions = perl_versions_filter (versions, ...);
versions = perl_versions_exclude (versions, ...);
versions = perl_versions_include (versions, ...);
// hypothetical support for `asc`/`desc` ordering with `devel first` / `devel last` 
versions = perl_versions_sort (versions, ...);

return versions;

Add a comma-separated 'exclude' input that removes specific versions
from the generated list, eliminating the need for shell-based
post-processing workarounds like jq filters.

Versions in the exclude list are normalized via decode_version(),
supporting formats like '5.32', 'v5.32', and 'devel'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Koan-Bot Koan-Bot force-pushed the koan.atoomic/add-exclude-input branch from 2235f1d to 9d2bbca Compare March 8, 2026 18:02
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.

2 participants