Skip to content

feat: warn when devel or version range unavailable for target#39

Draft
Koan-Bot wants to merge 2 commits into
perl-actions:mainfrom
atoomic:koan.atoomic/warn-devel-and-range
Draft

feat: warn when devel or version range unavailable for target#39
Koan-Bot wants to merge 2 commits into
perl-actions:mainfrom
atoomic:koan.atoomic/warn-devel-and-range

Conversation

@Koan-Bot

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

Copy link
Copy Markdown
Contributor

What

Add core.warning() messages when action inputs don't fully match the target's capabilities.

Why

Users requesting with-devel: true on windows-strawberry (which has no devel), or
since-perl: 5.8 on windows-strawberry (which starts at 5.14), get silently correct
but potentially confusing results. These warnings surface the mismatch early.

How

  • New target_info(target) function in perl-versions.js exposes has_devel, min_version,
    max_version for a given target
  • index.js checks these before calling perl_versions() and emits warnings via core.warning()
  • Three warning cases: devel unavailable, since-perl below min, until-perl above max

Testing

  • 4 new unit tests for target_info() — all pass
  • Full suite: 67/67 tests pass
  • dist/index.js rebuilt

🤖 Generated with Claude Code

Add core.warning() messages in the GitHub Action when:
- with-devel is requested but the target has no devel version
- since-perl is below the target's minimum available version
- until-perl is above the target's maximum available version

This gives users early feedback when their configuration doesn't
fully match the target's capabilities (e.g. requesting 5.8 on
windows-strawberry which starts at 5.14).

Adds target_info() helper to the core library with 4 unit tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread index.js Outdated
decode_version,
resolve_single_out
resolve_single_out,
target_info

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.

Diff reports changes to unrelated token resolve_single_out.
Use trailing comma after `target_info to prevent such behaviour in future.

If such eslint rule exists, force trailing comma on multiline objects and arrays.

Comment thread index.js Outdated

const target = core.getInput ('target') || 'perl-tester';

const info = target_info (target);

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.

I'd make this behaviour optional, with new input parameter (good name is eluding me so far) with values: "ignore" (default), "warn", "error" - how it should behave when requested version is not included in target versions.

In relation to comment #41 (comment)

there should be yet another builder function (using XXX as placeholder for proper name):

validator = build_validator_XXX (...);

versions = perl_versions_target  (target);

validator (versions, since_perl);
validator (versions, until_perl);
validator (versions, single_out);
validator (versions, "devel");

Implementation is then easier:

  • return if version is not defined
  • return if version exists in versions
  • report according value of XXX parameter

Though I'm still in doubt about single-out ...

@Koan-Bot

Koan-Bot commented Mar 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebase: feat: warn when devel or version range unavailable for target

Branch koan.atoomic/warn-devel-and-range has been rebased onto main and force-pushed.

Actions

  • Read PR comments and review feedback
  • Rebased koan.atoomic/warn-devel-and-range onto origin/main
  • Applied review feedback
  • Force-pushed koan.atoomic/warn-devel-and-range to origin

Automated by Kōan

Comment thread action.yml
type: string
required: false
default: "perl-tester"
version-mismatch:

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.

sync this changes with #38 ... both PRs add same input parameter with same behaviour as well as same evaluation logic.

Suggested next step:

  • let's use name on-version-mismatch
  • create function returning function: build_on_version_mismatch_reporter
    • returned function will accept arguments:
      • array of versions
    • identifier of tested version
    • tested version
    • function should skip when tested version is null or undefined (ie, logically false)
    • this returned function will be called:
      • on target versions when with-devel is true
      • on target versions with since-perl and until-perl
      • on filtered version with single-out

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