Skip to content

feat: add support for scheduled functions to Go client #368

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
merged 6 commits into from
Jan 4, 2022

Conversation

eduardoboucas
Copy link
Member

  • Adds a FunctionSchedules property to the deploy options when function schedules are detected
  • Adds a scheduled_functions log field to an existing log message, showing the number of scheduled functions detected for the deploy
  • Adds a new log message when a functions manifest file is detected

@eduardoboucas eduardoboucas added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jan 4, 2022
@eduardoboucas eduardoboucas requested a review from a team as a code owner January 4, 2022 09:53
@netlify
Copy link

netlify bot commented Jan 4, 2022

✔️ Deploy Preview for open-api ready!

🔨 Explore the source changes: f043261

🔍 Inspect the deploy log: https://app.netlify.com/sites/open-api/deploys/61d4190110c54600083c4d17

😎 Browse the preview: https://deploy-preview-368--open-api.netlify.app

@@ -91,7 +91,7 @@ type DeployOptions struct {

files *deployFiles
functions *deployFiles
functionSchedules []models.FunctionSchedule
functionSchedules []*models.FunctionSchedule
Copy link
Member Author

Choose a reason for hiding this comment

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

The change to pointers here is just so that it matches the FunctionSchedules type from DeployFiles without doing any conversion.

@@ -238,10 +238,15 @@ func (n *Netlify) DoDeploy(ctx context.Context, options *DeployOptions, deploy *
}
}

if len(schedules) > 0 {
deployFiles.FunctionSchedules = schedules
Copy link
Member Author

Choose a reason for hiding this comment

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

This is where we pass the schedules to the deploy options.

@@ -580,7 +585,7 @@ func walk(dir string, observer DeployObserver, useLargeMedia, ignoreInstallDirs
return files, err
}

func bundle(functionDir string, observer DeployObserver) (*deployFiles, []models.FunctionSchedule, error) {
func bundle(ctx context.Context, functionDir string, observer DeployObserver) (*deployFiles, []*models.FunctionSchedule, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

bundle and bundleFromManifest are now receiving the context so that they can acquire a logger and print a debug message.

@eduardoboucas eduardoboucas merged commit d7957ac into master Jan 4, 2022
@eduardoboucas eduardoboucas deleted the feat/scheduled-functions branch January 4, 2022 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants