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

BREAKING - Update function name displaying for info plugin #3239

Merged
merged 2 commits into from Feb 27, 2017

Conversation

pmuens
Copy link
Contributor

@pmuens pmuens commented Feb 13, 2017

What did you implement:

Updates the name so that it's the name one would use for e.g. the invoke command rather than the name on AWS (which introduces confusion).

/cc @brianneisler

How did you implement it:

Simply renamed the function name in the awsInfo plugin.

How can we verify it:

See the tests or do a serverless deploy or serverless info.

Todos:

  • Write tests
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: YES...for CI systems depending on stdout

@eahefnawy
Copy link
Member

hmmm imo we should not merge this. If the user wants to know the "short name" of the function he can look at serverless.yml, but I've always used the function name in the info plugin to know the "lambda name" so that I know what to look for in the AWS console, since most users don't necessarily know our default naming convention.

So I see no value in displaying the short name in the CLI, but I see some value for displaying the actual lambda name in the CLI

Just my two cents 😊 🙌

@eahefnawy
Copy link
Member

Is it a breaking change?: MAYBE...

Do you think some users might be using the stdout of the CLI in CI or such systems?

@pmuens
Copy link
Contributor Author

pmuens commented Feb 13, 2017

The main problem with the current approach is that new users who come to the framework might have problems with that since they do smth. like the following:

serverless create -t aws-nodejs

serverless deploy

Then they see the output of the info and then they want to invoke the function with the name they get from the info output.

@brianneisler stumbled upon this issue. At first, I too thought that it makes sense to display the full AWS name. The problem is that our goal is to keep the user out of the AWS console as much as possible. So why should the user see the name the function is deployed under on AWS.

Another valid argument is that he can see the name in the serverless.yml file. But having such a deployment summary is very convenient.

Maybe @brianneisler can share his view about this here.

Do you think some users might be using the stdout of the CLI in CI or such systems?

We've had the exact same issue when @nikgraf reviewed a PR where the output of the info plugin was refactored and slightly changed. We kept it the way it was. After that @nikgraf started a conversation about what we should declare as a breaking change. Not 100% where we ended here. So that's why i left a MAYBE... there 😄

@pmuens
Copy link
Contributor Author

pmuens commented Feb 14, 2017

Just pushed a change so that we get the best of both worlds.

The output now looks something like this and includes the name in the serverless.yml file and the deployed name:

Service Information
service: service
stage: dev
region: us-east-1
api keys:
  None
endpoints:
  GET - https://foo.execute-api.us-east-1.amazonaws.com/dev/goodbye
functions:
  hello: service-dev-hello
  goodbye: service-dev-goodbye

@eahefnawy
Copy link
Member

eahefnawy commented Feb 14, 2017

Deal Philipp, you are AWESOME! 😄 🥇

Haven't thought about all those points, thanks for clarifying!

Ok I say let's declare this as a breaking change, so that we do our part and notify the user about it. So that means lets merge this after the 1.7 release, and I'll add a note about it as a breaking change. I think it'll hit very few subset of users, but we care about them too 😊

@eahefnawy eahefnawy added this to the 1.8 milestone Feb 14, 2017
@eahefnawy eahefnawy changed the title Update function name displaying for info plugin BREAKING - Update function name displaying for info plugin Feb 14, 2017
@pmuens
Copy link
Contributor Author

pmuens commented Feb 14, 2017

@eahefnawy Thanks for the feedback!

Deal Philipp, you are AWESOME! 😄 🥇

❤️

Adding this to the next milestone as a breaking change sounds good to me!
The granularity of breaking change introduction might be too detailed here, but who knows 😄

@pmuens
Copy link
Contributor Author

pmuens commented Feb 14, 2017

BTW. The only user which comes to my mind who parses CLI output is... Serverless 😆

Remember the regex magic for the API keys integration test?

beforeAll(() => {
const info = execSync(`${Utils.serverlessExec} info`);
const stringifiedOutput = (new Buffer(info, 'base64').toString());
// some regex magic to extract the first API key value from the info output
apiKey = stringifiedOutput.match(/(api keys:\n)(\s*)(.+):(\s*)(.+)/)[5];
});

yikes 😅

@pmuens pmuens merged commit d77b5df into master Feb 27, 2017
@pmuens pmuens deleted the update-function-displaying-for-info-plugin branch February 27, 2017 09:10
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.

None yet

2 participants