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

Early failure for deploying an application with a function to an env #624

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

dianadoherty
Copy link
Contributor

Description of change

Early failure for deploying an application with a function to an env

Fixes #620

Type of change

  • New feature
  • Bug fix
  • Refactor
  • Documentation

How was this tested?

  • Unit Tests
  • Tested in staging
  • Tested in minikube

Demo

Before

meroxa apps deploy --env aws     
Validating your app.json...
	✔ Checked your language is "ruby"
	✔ Checked your application name is "test-rb"
Checking for uncommitted changes...
	✔ No uncommitted changes!
Preparing to deploy application "test-rb"...
	✔ Can access your Turbine resources
	✔ Application processes found. Creating application image...
	✔ Platform source fetched
	✔ Dockerfile created
	✔ "turbine-test-rb.tar.gz" successfully created in "/Users/dianadoherty/go/src/meroxa/test-rb"
	✔ Source uploaded
	✔ Removed "turbine-test-rb.tar.gz"
	✔ Dockerfile removed
	✔ Successfully built process image ("e8d91f4d-8a14-49a8-8213-3fb39d3fc370")
⠏ Deploying application "test-rb"...
	successfully validated application pipeline
	successfully created source connector
	cannot deploy functions to an environment
	x Couldn't complete the deployment
Error: 
 Check `meroxa apps logs` for further information

After

meroxa apps deploy --env aws
Validating your app.json...
	✔ Checked your language is "ruby"
	✔ Checked your application name is "test-rb"
Checking for uncommitted changes...
	✔ No uncommitted changes!
Preparing to deploy application "test-rb"...
	✔ Can access your Turbine resources
	x 	
Error: cannot deploy an application with a functions to an environment

@dianadoherty dianadoherty requested review from a team, hariso and ahmeroxa and removed request for a team February 3, 2023 16:49
Copy link
Member

@raulb raulb left a comment

Choose a reason for hiding this comment

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

@dianadoherty nicely done.

@dianadoherty dianadoherty merged commit 3d187d8 into master Feb 6, 2023
@dianadoherty dianadoherty deleted the app-with-fn-env branch February 6, 2023 14:56
// Prevent creation of function in an Env
if d.flags.Environment != "" {
d.logger.StopSpinnerWithStatus("\t", log.Failed)
return "", errors.New("cannot deploy an application with a functions to an environment")
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry i didn't review sooner. just noticed that functions is plural here with a singular article. could it be "one or more functions" so it doesn't have to be rewritten when we support more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! I think for now it's best to only mention one function, so I've went ahead and switched functions to singular function #627

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.

[Env: cli] Early detection of creating an app with a function in an environment
3 participants