[go: nahoru, domu]

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

Refactor Functions deploy code to use types that aren't literal API structs #3361

Merged
merged 6 commits into from
May 14, 2021

Conversation

inlined
Copy link
Member
@inlined inlined commented May 12, 2021

Previous versions of the Functions deploy code used a mangled type that wasn't a pure API CloudFunction and wasn't purely the type that we get from the SDK. This introduces a third "conceptual" type for FunctionSpec that we translate to and from so we can be much more rigorous about which format we're using at a given time. While we're at it, I:

  • Moved code from src/ to src/deploy/functions
  • Refactored the trigger parsing logic in preparation for a more "container contract" discovery mechanism
  • Updated some of the API calls we use
  • Cleaned up the GCP API calls with a new "proto" library that makes tedious tasks easier and safer

Add backend namespace before rebasing codebase onto it.

The Backend namespace defines types that are neither the __trigger
annotations nor the GCP API types. This follows Google best practices
for implementing services because it buffers the system from changes
in storage or API layers.

In this codebase, it will allow us to support new trigger discovery
techniques (e.g. a container contract HTTP API) and new versions
of APIs if they should ever be needed.

In this change I try out a new method for using args.Context; it's
based on the Go style of Context where a namespace can provide
a value using Context as a private implementation detail.
I'm personally a fan. WDYT?
Wire up new flag to the backend refactor
Function create and update should add deployment tool labels
Add CLI prompts for the new runWith options

Also accidentally merged:
Fix issues from bug bash

1. Remove the "No HTTPS functions" log line is no longer printed
2. The list of function URLs that are printed is now restricted to
   this deploy.
@inlined inlined requested review from joehan and taeold May 12, 2021 18:25
@google-cla google-cla bot added the cla: yes Manual indication that this has passed CLA. label May 12, 2021
@inlined
Copy link
Member Author
inlined commented May 12, 2021

Note: This is a "launch" branch of previously reviewed commits.

Copy link
Contributor
@joehan joehan left a comment

Choose a reason for hiding this comment

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

Reviewed all the previous PRs that went into this launch branch, and took a quick pass over this. LGTM!

@inlined inlined merged commit 16b2e96 into master May 14, 2021
inlined added a commit that referenced this pull request May 17, 2021
inlined added a commit that referenced this pull request May 17, 2021
joehan added a commit that referenced this pull request May 18, 2021
joehan added a commit that referenced this pull request May 19, 2021
* Revert "Revert "Refactor Functions deploy code to use types that aren't literal API structs (#3361)" (#3379)"

This reverts commit e438b26.

* Format fixes

* Fix bug with promptOnce in open command

Co-authored-by: Thomas Bouldin <inlined@google.com>
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
…tructs (firebase#3361)

* Functions deploy uses new "backend" types (firebase#3303)

Add backend namespace before rebasing codebase onto it.

The Backend namespace defines types that are neither the __trigger
annotations nor the GCP API types. This follows Google best practices
for implementing services because it buffers the system from changes
in storage or API layers.

In this codebase, it will allow us to support new trigger discovery
techniques (e.g. a container contract HTTP API) and new versions
of APIs if they should ever be needed.

In this change I try out a new method for using args.Context; it's
based on the Go style of Context where a namespace can provide
a value using Context as a private implementation detail.
I'm personally a fan. WDYT?

* Add format converters for the new backend flags (firebase#3333)

* Wire the new flags into the backend refactor (firebase#3334)

Wire up new flag to the backend refactor

* Create and Update Function should add deploymentTool labels (firebase#3356)

Function create and update should add deployment tool labels

* Add prompts for new runWith options (firebase#3352)

Add CLI prompts for the new runWith options

Also accidentally merged:
Fix issues from bug bash

1. Remove the "No HTTPS functions" log line is no longer printed
2. The list of function URLs that are printed is now restricted to
   this deploy.
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
* Revert "Revert "Refactor Functions deploy code to use types that aren't literal API structs (firebase#3361)" (firebase#3379)"

This reverts commit e438b26.

* Format fixes

* Fix bug with promptOnce in open command

Co-authored-by: Thomas Bouldin <inlined@google.com>
@bkendall bkendall deleted the launch.backend-refactor branch March 18, 2022 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants