feat: warn when devel or version range unavailable for target#39
feat: warn when devel or version range unavailable for target#39Koan-Bot wants to merge 2 commits into
Conversation
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>
| decode_version, | ||
| resolve_single_out | ||
| resolve_single_out, | ||
| target_info |
There was a problem hiding this comment.
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.
|
|
||
| const target = core.getInput ('target') || 'perl-tester'; | ||
|
|
||
| const info = target_info (target); |
There was a problem hiding this comment.
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 ...
Rebase: feat: warn when devel or version range unavailable for targetBranch Actions
Automated by Kōan |
| type: string | ||
| required: false | ||
| default: "perl-tester" | ||
| version-mismatch: |
There was a problem hiding this comment.
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
nullorundefined(ie, logically false) - this returned function will be called:
- on target versions when
with-develis true - on target versions with
since-perlanduntil-perl - on filtered version with
single-out
- on target versions when
- returned function will accept arguments:
What
Add
core.warning()messages when action inputs don't fully match the target's capabilities.Why
Users requesting
with-devel: trueonwindows-strawberry(which has no devel), orsince-perl: 5.8onwindows-strawberry(which starts at 5.14), get silently correctbut potentially confusing results. These warnings surface the mismatch early.
How
target_info(target)function inperl-versions.jsexposeshas_devel,min_version,max_versionfor a given targetindex.jschecks these before callingperl_versions()and emits warnings viacore.warning()Testing
target_info()— all passdist/index.jsrebuilt🤖 Generated with Claude Code