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

feat: storage module #13

Merged
merged 20 commits into from Jan 27, 2023
Merged

feat: storage module #13

merged 20 commits into from Jan 27, 2023

Conversation

Salakar
Copy link
Member

@Salakar Salakar commented Dec 14, 2022

See next comment for testing results.

Note: this PR also breaks out the example/ into multiple sample projects into samples/ for ease of deploying/testing functions specific to a module/service and for a later date for user samples.

@pr-Mais
Copy link
Member

pr-Mais commented Jan 19, 2023

Tested storage, here're results:

Function code:

from firebase_functions import storage
from firebase_functions.storage import StorageObjectData, CloudEvent
from firebase_admin import initialize_app

initialize_app()


@storage.on_object_finalized(bucket="python-functions-testing.appspot.com")
def on_object_finalized_example(event: CloudEvent[StorageObjectData]):
    print(event)

Deployment logs:
Screenshot 2023-01-19 at 9 23 26 PM

CloudEvent logs:
Screenshot 2023-01-19 at 9 23 14 PM

One note tho: bucket is optional now, but I think it should be made required. Unless there's a way to get the default bucket with the Admin SDK.

@Salakar Salakar marked this pull request as ready for review January 23, 2023 16:20
This is the bucket name without any prefixes or additions (without "gs://").
"""

# TODO more to be added later when they are required
Copy link
Member Author

Choose a reason for hiding this comment

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

@taeold FYI - left this as a TODO since none of the others were needed yet - thought it best to add them when they're required - is that ok?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd maybe add databaseURL here, but fair with me if you want to tackle it later.

This is the bucket name without any prefixes or additions (without "gs://").
"""

# TODO more to be added later when they are required
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd maybe add databaseURL here, but fair with me if you want to tackle it later.

@taeold taeold merged commit 4e181cb into firebase:main Jan 27, 2023
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

3 participants