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

Make --no-event the default for local invoke #1477

Merged
merged 3 commits into from
Oct 31, 2019

Conversation

awood45
Copy link
Member

@awood45 awood45 commented Oct 17, 2019

If no explicit --event is passed in, the default assumption is that no
event is desired. STDIN events must be explicit.

This is a breaking change.

Issue #, if available:

Description of changes:

Checklist:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

If no explicit `--event` is passed in, the default assumption is that no
event is desired. STDIN events must be explicit.

This is a breaking change.
@awood45 awood45 requested a review from sanathkr October 17, 2019 21:16
)
@click.option("--no-event", is_flag=True, default=False, help="Invoke Function with an empty event")
@click.option("--no-event", is_flag=True, default=True, help="DEPRECATED: By default no event is assumed.", hidden=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a plan to remove this option all together?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm open to that, question is if it's worth breaking people who are already using it. But by making it hidden, we're more or less de facto deleting it. The next step would be to drop values on the floor if someone goes to the trouble of doing --no-no-event or similar.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we actually add a line somewhere "DEPRECATED" onto stdout, before we start looking for values on stdin. Similair to how python2.7 was deprecated.

Copy link
Contributor

Choose a reason for hiding this comment

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

You don't have --no-no-event defined. So customers shouldn't be doing that at least. (https://click.palletsprojects.com/en/7.x/options/#boolean-flags).

I am ok not deleting it fully. You marked it as DEPRECATED in the help text, which would indicate we would remove it at some point. Maybe the right thing to do is not to that at all, and allow people to explicitly define --no-event. Once this is released, I am not sure why people would type more but it really doesn't hurt anything. If we are planning on removing completely, I would like us to have a way to do that was all. This is a non-blocking comment but worth thinking about.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think if someone explicitly defines --no-event there is no harm done - we're basically making it a no-op regardless, and I believe the deprecation flag removes it from help text anyways.

So perhaps the best way forward is to just leave it in place, but have it rendered inert.

@sriram-mv sriram-mv self-requested a review October 25, 2019 23:15
Copy link
Contributor

@sriram-mv sriram-mv left a comment

Choose a reason for hiding this comment

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

LGTM otherwise.

@awood45 awood45 requested review from sriram-mv and jfuss October 25, 2019 23:37
We don't want an exception, the test is invalid.
@awood45 awood45 merged commit 8711b5d into aws:develop Oct 31, 2019
@awood45 awood45 deleted the invoke-no-event-default branch October 31, 2019 16:23
@sparrowt
Copy link

sparrowt commented Dec 6, 2019

The documentation still says:

-e, --event PATH ... If you don't specify this option, the default is reading the JSON from stdin.

which is no longer true, and it took me a while to find that this breaking change was the reason I could no longer invoke via stdin without explicitly specifying --event -

Where is the best place to raise a ticket for updating the docs?

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.

4 participants