Skip to content

feat: validate other parameters against command parameter when used #1445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented Apr 29, 2025

Situation

When the input parameter command is used (see README > Custom test command) then multiple other command parameters are ignored without error or warning.

If related string parameters are set then they will be ignored.
Boolean input parameters are ignored if they are set different from their default settings.

Change

Validate input parameters used together with the command parameter and emit a GitHub Actions annotations warning if any ignored parameters are being used.

Example warning

This example contains all possible ignored parameters:

image

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 added the type: enhancement New feature or request label Apr 29, 2025
@MikeMcC399 MikeMcC399 self-assigned this Apr 29, 2025
@MikeMcC399 MikeMcC399 marked this pull request as ready for review April 29, 2025 13:35
@MikeMcC399 MikeMcC399 marked this pull request as draft April 29, 2025 14:55
@MikeMcC399 MikeMcC399 force-pushed the warn-incompatible-parameters branch from 4a380e5 to 0e2d89e Compare April 29, 2025 15:00
@MikeMcC399 MikeMcC399 force-pushed the warn-incompatible-parameters branch from 0e2d89e to f85f4d5 Compare April 29, 2025 15:04
@MikeMcC399 MikeMcC399 marked this pull request as ready for review April 29, 2025 15:37
@MikeMcC399
Copy link
Collaborator Author

MikeMcC399 commented Apr 29, 2025

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

This is a good idea. I wonder if an error state is desirable over a warning, but having this warning is a good first step to verify issues anyway.

@jennifer-shehane jennifer-shehane merged commit 0ee1130 into cypress-io:master May 1, 2025
73 checks passed
Copy link

github-actions bot commented May 1, 2025

🎉 This PR is included in version 6.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MikeMcC399 MikeMcC399 deleted the warn-incompatible-parameters branch May 2, 2025 06:33
@MikeMcC399
Copy link
Collaborator Author

@jennifer-shehane

This is a good idea. I wonder if an error state is desirable over a warning, but having this warning is a good first step to verify issues anyway.

The validation does not stop the workflow running and it can still be successful running the command specified in the command parameter, even if other parameters are specified and are ignored. Warning seemed like the best choice in this case.

A error message (rather than a warning) would fit better together with failing the workflow. That however would be a breaking change and I don't think it is necessary or desirable to fail such a workflow at this time.

We can revisit after seeing if there is any specific feedback on the change. The main goal was to inform workflow authors that their parameter(s) would be ignored in this situation, so that they have the information to review their parameters and make corrections.

Moving from warning to failing at a later time would be like first deprecating a function then removing it at a later time. The timeline for a transition like this should be at least a few months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Produce action warning if parameters incompatible with command parameter are used
3 participants