Skip to content

Conversation

@kraenhansen
Copy link
Contributor

Description

Unfortunately default values by-pass yarg's validation: Here's a few suggestions to avoid a type assert and potential runtime issue if ARCH or PLATFORM environment variables doesn't match the supported values.

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@kraenhansen kraenhansen added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Jan 13, 2025
@kraenhansen kraenhansen requested a review from lerouxb January 13, 2025 13:22
@kraenhansen kraenhansen self-assigned this Jan 13, 2025
@kraenhansen kraenhansen force-pushed the kh/smoke-test/refactor-platform-and-archs branch from 26e04ff to ccf4d5d Compare January 13, 2025 13:25
const parsedArgs = argv.parseSync();

const context = parsedArgs as SmokeTestsContext;
const context: SmokeTestsContext = argv.parseSync();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I would have either used satisfies here (but our prettier's typescript parser needs an update to support that) or simply deleted the type now that it matches the expected type.

Suggested change
const context: SmokeTestsContext = argv.parseSync();
const context = argv.parseSync() satisfies SmokeTestsContext;

@kraenhansen kraenhansen merged commit d464748 into main Jan 14, 2025
28 of 31 checks passed
@kraenhansen kraenhansen deleted the kh/smoke-test/refactor-platform-and-archs branch January 14, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants