octabytes / FireO

Google Cloud Firestore modern and simplest convenient ORM package in Python. FireO is specifically designed for the Google's Firestore
https://fireo.octabyte.io
Apache License 2.0
247 stars 29 forks source link

Add TypedModel and more #186

Closed ADR-007 closed 1 year ago

ADR-007 commented 1 year ago

Example:

from typing import List
from fireo.typedmodels import TypedModel

class Comment(TypedModel):
    text: str
    likes: int = 0

class User(TypedModel):
    name: str
    age: int
    comments: List[Comment] = []  # Mutable default value is safe to use

# Use the model as usual:
user = User(name='John', age=30)
user.save()
ADR-007 commented 1 year ago

Hi @AxeemHaider, could you please check the CI error?

Error: google-github-actions/auth failed with: retry function failed after 1 attempt: 
the GitHub Action workflow must specify exactly one of "workload_identity_provider" or "credentials_json"! 
If you are specifying input values via GitHub secrets, ensure the secret is being injected into the environment. 
By default, secrets are not passed to workflows triggered from forks, including Dependabot.
AxeemHaider commented 1 year ago

Hi @AxeemHaider, could you please check the CI error?

Error: google-github-actions/auth failed with: retry function failed after 1 attempt: 
the GitHub Action workflow must specify exactly one of "workload_identity_provider" or "credentials_json"! 
If you are specifying input values via GitHub secrets, ensure the secret is being injected into the environment. 
By default, secrets are not passed to workflows triggered from forks, including Dependabot.

This error happen because ENV are not shared with PR. And I'm not able to find any setting where I can allow these. Google firestore emulator require GCP authentication to run test. Don't know why they require auth for emulator before that it was working perfect without auth but now auth is require even you run emulator.

I set auth in environment variables which are use to run emulator. But these env are not shared with PR. Is there any way we can allow them for PR.