Skip to content
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

Allow only common trigger options in multi-trigger apps #2257

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

itowlson
Copy link
Contributor

Alternative to #2255 to address #2251

@itowlson itowlson requested review from lann and rylev January 29, 2024 21:56
Copy link
Collaborator

@rylev rylev left a comment

Choose a reason for hiding this comment

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

This looks good to me!

}
}

const COMMON_FLAGS: &[&str] = &[
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we comment that these flags are common to all well-known trigger types.

Comment on lines +452 to +453
for i in 0..(args.len()) {
let Some(value) = args[i].to_str() else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for i in 0..(args.len()) {
let Some(value) = args[i].to_str() else {
for (i, arg) in args.iter().enumerate() {
let Some(value) = arg.to_str() else {

};
if value.starts_with('-') {
// Flag candidate. Is it allowed?
if !is_common_flag(value) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I would personally inline this function.

@vdice vdice added this to the 2.2 milestone Jan 30, 2024
@itowlson
Copy link
Contributor Author

@rylev Thanks for the review - all good points. Unfortunately, as we want to land this for 2.2, I'm going to have to punt them to a tidy-up PR - sorry. Also, as I'm already looking at Option 3 (and have it working on the happy path), which would enable trigger-specific flags, tidyings to this may become moot, but we'll see how it goes.

@itowlson itowlson merged commit 3658ba6 into fermyon:main Jan 30, 2024
11 checks passed
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.

3 participants