Skip to content

Update development documentation for setup and workflow #63

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

GabLeRoux
Copy link
Member

@GabLeRoux GabLeRoux commented Apr 25, 2025

This pull request improves documentation for the GameCI Versioning Backend by restructuring the DEVELOPMENT.md file and expanding the README.md to provide a more comprehensive system overview. The changes aim to enhance clarity, usability, and accessibility for developers.

Documentation Improvements:

Development Setup and Workflow

  • DEVELOPMENT.md: Restructured the document into clear sections, including prerequisites, setup instructions, credentials configuration, and troubleshooting tips. Added details on running Firebase locally, setting up environment variables, and deploying the backend.

System Overview and Features

  • README.md: Expanded to include a system overview with a mermaid diagram, detailed explanations of Unity version ingestion, CI job workflows, the scheduler, and the Ingeminator. Also added instructions for database backup and restoration.

Summary by CodeRabbit

  • Documentation
    • Significantly expanded and restructured the development guide with clear setup steps, environment configuration, workflow instructions, and troubleshooting tips.
    • Enhanced the README with detailed system architecture, workflow descriptions, diagrams, and comprehensive operational procedures.
    • Added new sections for development and contribution guidelines to improve onboarding and reference for contributors.
  • Bug Fixes
    • Updated emulator hosting port to avoid conflicts by changing it from 5000 to 5002.

@GabLeRoux GabLeRoux requested review from AndrewKahr and Copilot April 25, 2025 14:11
Copy link

coderabbitai bot commented Apr 25, 2025

Warning

Rate limit exceeded

@GabLeRoux has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 57 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 09ab610 and 3c36a64.

📒 Files selected for processing (1)
  • DEVELOPMENT.md (1 hunks)

Walkthrough

The changes consist of extensive revisions to the DEVELOPMENT.md and README.md documentation files. The DEVELOPMENT.md file was restructured to provide detailed and segmented instructions for setup, credentials, deployment, workflow, and troubleshooting. The README.md was expanded to include comprehensive explanations of the system's architecture, workflows, and components, with the addition of diagrams and explicit operational procedures. Additionally, the firebase.json configuration was updated to change the hosting emulator port from 5000 to 5002. No code or exported entities were modified; all updates are limited to documentation content.

Changes

File(s) Change Summary
DEVELOPMENT.md Completely revised and expanded: added detailed prerequisites, setup, credentials, deployment, workflow, and troubleshooting sections; improved formatting and clarity.
README.md Extensively expanded and restructured: added system overview, Mermaid architecture diagram, detailed workflow explanations, new sections for development and contributing, and explicit operational procedures.
firebase.json Changed hosting emulator port from 5000 to 5002; no other configuration changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Documentation

    User->>Documentation: Reads DEVELOPMENT.md for setup and workflow
    User->>Documentation: Reads README.md for system overview and architecture
    Documentation-->>User: Provides structured guidance, diagrams, and procedures
Loading

Poem

In docs we trust, with guides anew,
Setup and workflows, clear as dew.
Diagrams dance, instructions bloom,
Troubles melt in the dev room.
With every page, a rabbit’s cheer—
Happy hacking, far and near!
((\
( -.-)
o_(")(")


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates and improves the documentation for the GameCI Versioning Backend. The changes reorganize DEVELOPMENT.md into clear, step-by-step sections and expand README.md with a comprehensive system overview, including a mermaid diagram and detailed descriptions of CI job workflows.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
README.md Expanded system overview, CI job workflow explanations, and introduced a mermaid diagram for process visualization.
DEVELOPMENT.md Reorganized development setup instructions, added prerequisites, credentials setup, and troubleshooting guidelines.
Comments suppressed due to low confidence (2)

README.md:16

  • [nitpick] Consider aligning the naming in the mermaid diagram with the documentation text; either consistently refer to the component as 'Ingeminator' or include its alias 'repeater' for clarity.
H[Ingeminator] -->|Retry Failed Builds| F

DEVELOPMENT.md:67

  • [nitpick] Using a dot in the configuration key (e.g. 'discord.token') is unconventional for environment variable names; if this naming is required by Firebase configuration, consider adding a brief note to clarify its purpose.
export discord.token="your_discord_token"

@GabLeRoux
Copy link
Member Author

This is an improved version of #53 so I'll just close previous one.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (3)
README.md (2)

30-40: Specify code block language for CI Job Workflow
The ASCII diagram is in a fenced block without a language specifier. To satisfy markdownlint and improve readability, consider:

- ```
+ ```text
  CiJob (e.g., Unity 2022.3.15f1)
  ├── CiBuild: ubuntu-2022.3.15f1-webgl
  └── … 
- ```
+ ```
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

34-34: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


51-59: Optional: Simplify nested quotes
In “Ingeminator” you have The Ingeminator ("repeater"). To avoid escaping, you might write:

The Ingeminator (alias 'repeater')

DEVELOPMENT.md (1)

123-126: Grammar tweak for step description
Change “Make changes to code in functions/src/” to “Make changes to the code in functions/src/” for smoother reading.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 016f95a and cc078ee.

📒 Files selected for processing (2)
  • DEVELOPMENT.md (1 hunks)
  • README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
DEVELOPMENT.md

[uncategorized] ~115-~115: The preposition ‘to’ seems more likely in this position.
Context: ...pment Workflow 1. Make changes to code in functions/src/ 2. Run the emulator to...

(AI_HYDRA_LEO_REPLACE_IN_TO)

README.md

[grammar] ~61-~61: The word ‘Backup’ is a noun. Do you mean the verb “Back up”?
Context: ...e retry priorities ## Database Backup Backup the Firestore database: ```bash export ...

(SENT_START_BACKUP)

🪛 markdownlint-cli2 (0.17.2)
README.md

34-34: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test Deploy
🔇 Additional comments (10)
README.md (4)

3-4: Well-articulated introduction
This expanded intro succinctly explains the backend’s purpose and main integrations, greatly improving clarity for new contributors.


5-18: Solid System Overview with Mermaid diagram
The visual depiction of component interactions is clear and immediately conveys the architecture flow. Great addition!


20-28: Clear Unity Version Ingest section
The enumerated steps lay out the ingest pipeline in a structured way—easy to follow and comprehensive.


73-80: Great linking to development and contribution guides
Pointing readers to DEVELOPMENT.md and CONTRIBUTING.md rounds out the documentation and directs contributors where to go next.

DEVELOPMENT.md (6)

1-4: Comprehensive Guide Title and Overview
The new title and intro clearly set expectations for the development flow—excellent for first-time contributors.


5-12: Well-defined Prerequisites section
Listing Node.js, Yarn, and Firebase CLI (with version managers) makes onboarding smoother.


13-40: Clear Setup instructions
Step-by-step commands for installing the Firebase CLI, project dependencies, and running emulators are concise and accurate.


88-108: Deployment commands are clear
The Firebase login and deploy examples (full and selective) are straightforward and actionable.


110-119: Firebase Configuration section is thorough
The functions:config:set commands for rotating or migrating tokens are precise and well documented.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~115-~115: The preposition ‘to’ seems more likely in this position.
Context: ...pment Workflow 1. Make changes to code in functions/src/ 2. Run the emulator to...

(AI_HYDRA_LEO_REPLACE_IN_TO)


143-148: Useful Troubleshooting tips
This section addresses the most common gotchas (auth, ports, permissions)—a great aid for local development.

README.md Outdated
Comment on lines 60 to 66
## Database Backup

The firestore database can be backed up with the following command:
`yarn run backfire export ./export/versioningBackendBackup --project unity-ci-versions --keyFile <PATH_TO_GOOGLE_CLOUD_SERVICE_ACCOUNT_KEYFILE.json>`
Backup the Firestore database:
```bash
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/serviceAccountKey.json"
yarn run backfire export ./export/versioningBackendBackup --project unity-ci-versions --keyFile $GOOGLE_APPLICATION_CREDENTIALS
```
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Unify terminology and fix grammar

  • Use the imperative “Back up the Firestore database:” instead of the noun “Backup.”
  • The example references serviceAccountKey.json, but DEVELOPMENT.md uses service-account-file.json. Pick one filename across docs to avoid confusion.
🧰 Tools
🪛 LanguageTool

[grammar] ~61-~61: The word ‘Backup’ is a noun. Do you mean the verb “Back up”?
Context: ...e retry priorities ## Database Backup Backup the Firestore database: ```bash export ...

(SENT_START_BACKUP)

@NuclearCookie
Copy link

I'll post my feedback here as I follow the Development documentation:

When running firebase emulators:start I get the following log output:

⚠  emulators: You are not currently authenticated so some features may not work correctly. Please run firebase login to authenticate the CLI.
i  emulators: Shutting down emulators.

Error: Process `java -version` has exited with code 1. Please make sure Java is installed and on your system PATH.
-----Original stdout-----
-----Original stderr-----
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

I'll now proceed with first logging in and making sure I have Java available in this environment, then continue to give feedback

@NuclearCookie
Copy link

Logged in and made sure JAVA was available on path, now get this:

i  emulators: Starting emulators: functions, firestore, hosting, pubsub, storage, extensions
⬢  extensions: Unable to look up project number for unity-ci-versions.
 If this is a real project, ensure that you are logged in and have access to it.
 If this is a fake project, please use a project ID starting with 'demo-' to skip production calls.
 Continuing with a fake project number - secrets and other features that require production access may behave unexpectedly.
⚠  hosting: Port 5000 is not open on localhost (127.0.0.1,::1), could not start Hosting Emulator.
⚠  hosting: To select a different host/port, specify that host/port in a firebase.json config file:
      {
        // ...
        "emulators": {
          "hosting": {
            "host": "HOST",
            "port": "PORT"
          }
        }
      }
i  emulators: Shutting down emulators.

Error: Could not start Hosting Emulator, port taken.

This is due to Mac's port 5000 being used by airplay receiver. I'll continue with a different port and report back

@NuclearCookie
Copy link

After changing the hosting port to 5002, the firebase command succeeded:


    "hosting": {
      "port": 5002
    },
    ```

@NuclearCookie
Copy link

Now that I have the firebase CLI up and running, I do believe I have more issues.
Here's the output of running the emulators:

➜  versioning-backend git:(main) firebase emulators:start
i  emulators: Starting emulators: functions, firestore, hosting, pubsub, storage, extensions
⬢  extensions: Unable to look up project number for unity-ci-versions.
 If this is a real project, ensure that you are logged in and have access to it.
 If this is a fake project, please use a project ID starting with 'demo-' to skip production calls.
 Continuing with a fake project number - secrets and other features that require production access may behave unexpectedly.
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: apphosting, auth, database, dataconnect
⚠  functions: Unable to fetch project Admin SDK configuration, Admin SDK behavior in Cloud Functions emulator may be incorrect.
i  firestore: downloading cloud-firestore-emulator-v1.19.8.jar...
Progress: =============================================================================================================> (100% of 64MB)
i  firestore: Firestore Emulator logging to firestore-debug.log
✔  firestore: Firestore Emulator UI websocket is running on 9150.
i  pubsub: downloading pubsub-emulator-0.8.14.zip...
Progress: =============================================================================================================> (100% of 67MB)
i  pubsub: Pub/Sub Emulator logging to pubsub-debug.log
i  storage: downloading cloud-storage-rules-runtime-v1.1.3.jar...
Progress: =============================================================================================================> (100% of 53MB)
⚠  hosting: Authentication error when trying to fetch your current web app configuration, have you run firebase login?
⚠  hosting: Could not fetch web app configuration and there is no cached configuration on this machine. Check your internet connection and make sure you are authenticated. To continue, you must call firebase.initializeApp({...}) in your code before using Firebase.
i  hosting[unity-ci-versions]: Serving hosting files from: public
✔  hosting[unity-ci-versions]: Local server: http://127.0.0.1:5002
i  ui: downloading ui-v1.14.0.zip...
Progress: ==============================================================================================================> (100% of 4MB)
i  functions: Watching "/Users/pietervantorre/Projects/github/game-ci/versioning-backend/functions" for Cloud Functions...
⚠  functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
⬢  functions: Failed to load function definition from source: FirebaseError: There was an error reading functions/package.json:

 functions/lib/index.js does not exist, can't deploy Cloud Functions

┌─────────────────────────────────────────────────────────────┐
│ ✔  All emulators ready! It is now safe to connect your app. │
│ i  View Emulator UI at http://127.0.0.1:4000/               │
└─────────────────────────────────────────────────────────────┘

┌────────────┬────────────────┬──────────────────────────────────┐
│ Emulator   │ Host:Port      │ View in Emulator UI              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Functions  │ 127.0.0.1:5001 │ http://127.0.0.1:4000/functions  │
├────────────┼────────────────┼──────────────────────────────────┤
│ Firestore  │ 127.0.0.1:8080 │ http://127.0.0.1:4000/firestore  │
├────────────┼────────────────┼──────────────────────────────────┤
│ Hosting    │ 127.0.0.1:5002 │ n/a                              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Pub/Sub    │ 127.0.0.1:8085 │ n/a                              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Storage    │ 127.0.0.1:9199 │ http://127.0.0.1:4000/storage    │
├────────────┼────────────────┼──────────────────────────────────┤
│ Extensions │ 127.0.0.1:5001 │ http://127.0.0.1:4000/extensions │
└────────────┴────────────────┴──────────────────────────────────┘
  Emulator Hub host: 127.0.0.1 port: 4400
  Other reserved ports: 4500, 9150
┌─────────────────────────┬───────────────┬─────────────────────┐
│ Extension Instance Name │ Extension Ref │ View in Emulator UI │
└─────────────────────────┴───────────────┴─────────────────────┘
Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files

Most notably it can't deploy the cloud functions.
Note that I didn't setup the credentials. Is that what I'm missing here?
It wasn't clear to me why I needed those

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
DEVELOPMENT.md (1)

50-66: Nitpick: Add definite article for AirPlay Receiver
LanguageTool suggests adding “the” before “AirPlay Receiver” for grammatical clarity.
Apply this diff:

-On macOS, port 5000 (used by the Hosting emulator) might be in use by AirPlay Receiver. You can configure a different port in your `firebase.json`:
+On macOS, port 5000 (used by the Hosting emulator) might be in use by the AirPlay Receiver. You can configure a different port in your `firebase.json`:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~50-~50: Possible missing article found.
Context: ...he Hosting emulator) might be in use by AirPlay Receiver. You can configure a different...

(AI_HYDRA_LEO_MISSING_THE)

README.md (1)

34-40: Nitpick: Specify fenced code block language
markdownlint flags the CI Job ASCII diagram as missing a language. Consider using text for better linting:

-```
+```text
 CiJob (e.g., Unity 2022.3.15f1)
   ├── CiBuild: ubuntu-2022.3.15f1-webgl
   ├── CiBuild: ubuntu-2022.3.15f1-android
   ├── CiBuild: windows-2022.3.15f1-webgl
   └── ... (other baseOS-version-targetPlatform combinations)
-```
+```
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

34-34: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf35347 and 09ab610.

📒 Files selected for processing (3)
  • DEVELOPMENT.md (1 hunks)
  • README.md (1 hunks)
  • firebase.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • firebase.json
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

34-34: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🪛 LanguageTool
DEVELOPMENT.md

[uncategorized] ~50-~50: Possible missing article found.
Context: ...he Hosting emulator) might be in use by AirPlay Receiver. You can configure a different...

(AI_HYDRA_LEO_MISSING_THE)

🔇 Additional comments (20)
DEVELOPMENT.md (11)

7-10: Comprehensive Prerequisites
The prerequisites section clearly lists all necessary tools and versions.


19-19: Install Firebase CLI via NPM
Using npm i -g firebase-tools is clear and effective for most environments.


27-33: Dependency Installation Steps
Installing dependencies at both the repository root and in functions is correctly documented.


38-39: Local Emulator Startup
Documenting firebase emulators:start provides a straightforward way to run functions and Firestore locally.


45-47: Emulator Prerequisites
Calling out Java and Firebase login requirements upfront will help prevent common setup errors.


79-85: Service Account Configuration
The instructions for setting GOOGLE_APPLICATION_CREDENTIALS on both macOS/Linux and PowerShell are correct and clear.


93-105: Integration Environment Variables
Clearly listing Discord, GitHub, and internal token environment variables uses consistent uppercase naming conventions.


115-126: Deployment Commands
Login and deployment steps (full and partial) are well-documented and include the necessary --only flag for targeted deploys.


133-140: Firebase Functions Configuration
Showing both dot-notation for CLI and uppercase env var usage locally clarifies the distinction.


143-154: Development Workflow
The multi-terminal setup for hot-reloading and testing is adequately described and aligns with common Firebase Function development patterns.


161-170: Troubleshooting Section
Covering login issues, port conflicts, Java errors, SDK permissions, and integration issues provides helpful quick fixes for developers.

README.md (9)

3-3: Overview Introduction
The expanded introduction effectively summarizes the backend’s purpose and integrations.


7-18: System Architecture Diagram
The Mermaid diagram clearly illustrates component interactions and data flow.


22-28: Unity Version Ingest Details
Step-by-step bullet points for version detection, filtering, storage, and notifications are concise and informative.


46-49: Scheduler Responsibilities
The bullet list accurately highlights job prioritization, retry coordination, and concurrency limits.


53-58: Ingeminator Section
Describing exponential backoff, retry alerts, and scheduler coordination improves clarity around reliability mechanisms.


62-67: Database Backup Commands
Providing both export and import commands with environment variable usage offers a complete backup workflow.


69-71: Restore Workflow
Including the restore command directly after the export instructions ensures users can both back up and restore with the same CLI setup.


75-75: Development Link
Linking to DEVELOPMENT.md from the README encourages developers to follow the detailed setup guide.


77-79: Contributing Section
Pointing to CONTRIBUTING.md clearly outlines the path for external contributions.

@GabLeRoux
Copy link
Member Author

After changing the hosting port to 5002, the firebase command succeeded:


    "hosting": {
      "port": 5002
    },
    ```

I've applied your suggestion here: 09ab610 and here 0bf2450 to prevent conflict with Apple Airplay receiver on port 5000 on macOS 👍

@GabLeRoux
Copy link
Member Author

GabLeRoux commented Apr 25, 2025

Now that I have the firebase CLI up and running, I do believe I have more issues. Here's the output of running the emulators:

➜  versioning-backend git:(main) firebase emulators:start
i  emulators: Starting emulators: functions, firestore, hosting, pubsub, storage, extensions
⬢  extensions: Unable to look up project number for unity-ci-versions.
 If this is a real project, ensure that you are logged in and have access to it.
 If this is a fake project, please use a project ID starting with 'demo-' to skip production calls.
 Continuing with a fake project number - secrets and other features that require production access may behave unexpectedly.
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: apphosting, auth, database, dataconnect
⚠  functions: Unable to fetch project Admin SDK configuration, Admin SDK behavior in Cloud Functions emulator may be incorrect.
i  firestore: downloading cloud-firestore-emulator-v1.19.8.jar...
Progress: =============================================================================================================> (100% of 64MB)
i  firestore: Firestore Emulator logging to firestore-debug.log
✔  firestore: Firestore Emulator UI websocket is running on 9150.
i  pubsub: downloading pubsub-emulator-0.8.14.zip...
Progress: =============================================================================================================> (100% of 67MB)
i  pubsub: Pub/Sub Emulator logging to pubsub-debug.log
i  storage: downloading cloud-storage-rules-runtime-v1.1.3.jar...
Progress: =============================================================================================================> (100% of 53MB)
⚠  hosting: Authentication error when trying to fetch your current web app configuration, have you run firebase login?
⚠  hosting: Could not fetch web app configuration and there is no cached configuration on this machine. Check your internet connection and make sure you are authenticated. To continue, you must call firebase.initializeApp({...}) in your code before using Firebase.
i  hosting[unity-ci-versions]: Serving hosting files from: public
✔  hosting[unity-ci-versions]: Local server: http://127.0.0.1:5002
i  ui: downloading ui-v1.14.0.zip...
Progress: ==============================================================================================================> (100% of 4MB)
i  functions: Watching "/Users/pietervantorre/Projects/github/game-ci/versioning-backend/functions" for Cloud Functions...
⚠  functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
⬢  functions: Failed to load function definition from source: FirebaseError: There was an error reading functions/package.json:

 functions/lib/index.js does not exist, can't deploy Cloud Functions

┌─────────────────────────────────────────────────────────────┐
│ ✔  All emulators ready! It is now safe to connect your app. │
│ i  View Emulator UI at http://127.0.0.1:4000/               │
└─────────────────────────────────────────────────────────────┘

┌────────────┬────────────────┬──────────────────────────────────┐
│ Emulator   │ Host:Port      │ View in Emulator UI              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Functions  │ 127.0.0.1:5001 │ http://127.0.0.1:4000/functions  │
├────────────┼────────────────┼──────────────────────────────────┤
│ Firestore  │ 127.0.0.1:8080 │ http://127.0.0.1:4000/firestore  │
├────────────┼────────────────┼──────────────────────────────────┤
│ Hosting    │ 127.0.0.1:5002 │ n/a                              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Pub/Sub    │ 127.0.0.1:8085 │ n/a                              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Storage    │ 127.0.0.1:9199 │ http://127.0.0.1:4000/storage    │
├────────────┼────────────────┼──────────────────────────────────┤
│ Extensions │ 127.0.0.1:5001 │ http://127.0.0.1:4000/extensions │
└────────────┴────────────────┴──────────────────────────────────┘
  Emulator Hub host: 127.0.0.1 port: 4400
  Other reserved ports: 4500, 9150
┌─────────────────────────┬───────────────┬─────────────────────┐
│ Extension Instance Name │ Extension Ref │ View in Emulator UI │
└─────────────────────────┴───────────────┴─────────────────────┘
Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files

Most notably it can't deploy the cloud functions. Note that I didn't setup the credentials. Is that what I'm missing here? It wasn't clear to me why I needed those

The part here:

functions/lib/index.js does not exist, can't deploy Cloud Functions

I think you need to build first (cd functions && yarn build), I've updated docs to reflect this. Also, yes, it's useful to create a firebase project and authenticate with it as well. I've updated the docs accordingly too: 3c36a64

@NuclearCookie
Copy link

NuclearCookie commented Apr 25, 2025

I confirm I got further after building!
Can I propose to maybe add that step explicitly to the setup documentation, and not just at the bottom for the Development Workflow? As far as I understood now it's an essential step to run when setting up the project for the first time.
Edit: My bad, looked at the outdated documentation! LGTM

I will now try to create the firebase project and authenticate and report back

@NuclearCookie
Copy link

I have setup the firebase project and authenticated, but don't see much of a difference.

Note that I also tried to make sure the env variable exists by trying like this:
export GOOGLE_APPLICATION_CREDENTIALS="/Users/user/Projects/github/game-ci/versioning-backend/gameci-versioning-backend-test-firebase-adminsdk-fbsvc-b9db02a91a.json" && firebase emulators:start

Here's the output from the command now:

➜  versioning-backend git:(main) ✗ firebase login
Already logged in as [email protected]
➜  versioning-backend git:(main) ✗ export GOOGLE_APPLICATION_CREDENTIALS="/Users/pietervantorre/Projects/github/game-ci/versioning-backend/gameci-versioning-backend-test-firebase-adminsdk-fbsvc-b9db02a91a.json" && firebase emulators:start
i  emulators: Starting emulators: functions, firestore, hosting, pubsub, storage, extensions
⬢  extensions: Unable to look up project number for unity-ci-versions.
 If this is a real project, ensure that you are logged in and have access to it.
 If this is a fake project, please use a project ID starting with 'demo-' to skip production calls.
 Continuing with a fake project number - secrets and other features that require production access may behave unexpectedly.
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: apphosting, auth, database, dataconnect
⚠  functions: Application Default Credentials detected. Non-emulated services will access production using these credentials. Be careful!
⚠  functions: Unable to fetch project Admin SDK configuration, Admin SDK behavior in Cloud Functions emulator may be incorrect.
i  firestore: Firestore Emulator logging to firestore-debug.log
✔  firestore: Firestore Emulator UI websocket is running on 9150.
i  pubsub: Pub/Sub Emulator logging to pubsub-debug.log
⚠  hosting: Authentication error when trying to fetch your current web app configuration, have you run firebase login?
⚠  hosting: Could not fetch web app configuration and there is no cached configuration on this machine. Check your internet connection and make sure you are authenticated. To continue, you must call firebase.initializeApp({...}) in your code before using Firebase.
i  hosting[unity-ci-versions]: Serving hosting files from: public
✔  hosting[unity-ci-versions]: Local server: http://127.0.0.1:5002
i  functions: Watching "/Users/pietervantorre/Projects/github/game-ci/versioning-backend/functions" for Cloud Functions...
⚠  functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
⚠  functions: Your requested "node" version "20" doesn't match your global version "23". Using node@23 from host.
Serving at port 8421

[email protected]: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: getaddrinfo ENOTFOUND metadata.google.internal. Error code: ENOTFOUND"..
[email protected]: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: getaddrinfo ENOTFOUND metadata.google.internal. Error code: ENOTFOUND"..
[email protected]: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: getaddrinfo ENOTFOUND metadata.google.internal. Error code: ENOTFOUND"..
[email protected]: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: getaddrinfo ENOTFOUND metadata.google.internal. Error code: ENOTFOUND"..

⚠  functions: Application Default Credentials detected. Non-emulated services will access production using these credentials. Be careful!
✔  functions: Loaded functions definitions from source: model.editorVersion.onCreate, model.repoVersion.onCreate, cron.trigger, queueStatus, reportBuildFailure, reportNewBuild, reportPublication, unityVersions, retryBuild, testFunction.
✔  functions[europe-west3-model-editorVersion-onCreate]: firestore function initialized.
✔  functions[europe-west3-model-repoVersion-onCreate]: firestore function initialized.
✔  functions[europe-west3-cron-trigger]: pubsub function initialized.
✔  functions[europe-west3-queueStatus]: http function initialized (http://127.0.0.1:5001/unity-ci-versions/europe-west3/queueStatus).
✔  functions[europe-west3-reportBuildFailure]: http function initialized (http://127.0.0.1:5001/unity-ci-versions/europe-west3/reportBuildFailure).
✔  functions[europe-west3-reportNewBuild]: http function initialized (http://127.0.0.1:5001/unity-ci-versions/europe-west3/reportNewBuild).
✔  functions[europe-west3-reportPublication]: http function initialized (http://127.0.0.1:5001/unity-ci-versions/europe-west3/reportPublication).
✔  functions[europe-west3-unityVersions]: http function initialized (http://127.0.0.1:5001/unity-ci-versions/europe-west3/unityVersions).
✔  functions[europe-west3-retryBuild]: http function initialized (http://127.0.0.1:5001/unity-ci-versions/europe-west3/retryBuild).
✔  functions[europe-west3-testFunction]: http function initialized (http://127.0.0.1:5001/unity-ci-versions/europe-west3/testFunction).

┌─────────────────────────────────────────────────────────────┐
│ ✔  All emulators ready! It is now safe to connect your app. │
│ i  View Emulator UI at http://127.0.0.1:4000/               │
└─────────────────────────────────────────────────────────────┘

┌────────────┬────────────────┬──────────────────────────────────┐
│ Emulator   │ Host:Port      │ View in Emulator UI              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Functions  │ 127.0.0.1:5001 │ http://127.0.0.1:4000/functions  │
├────────────┼────────────────┼──────────────────────────────────┤
│ Firestore  │ 127.0.0.1:8080 │ http://127.0.0.1:4000/firestore  │
├────────────┼────────────────┼──────────────────────────────────┤
│ Hosting    │ 127.0.0.1:5002 │ n/a                              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Pub/Sub    │ 127.0.0.1:8085 │ n/a                              │
├────────────┼────────────────┼──────────────────────────────────┤
│ Storage    │ 127.0.0.1:9199 │ http://127.0.0.1:4000/storage    │
├────────────┼────────────────┼──────────────────────────────────┤
│ Extensions │ 127.0.0.1:5001 │ http://127.0.0.1:4000/extensions │
└────────────┴────────────────┴──────────────────────────────────┘
  Emulator Hub host: 127.0.0.1 port: 4400
  Other reserved ports: 4500, 9150
┌─────────────────────────┬───────────────┬─────────────────────┐
│ Extension Instance Name │ Extension Ref │ View in Emulator UI │
└─────────────────────────┴───────────────┴─────────────────────┘
Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files

@NuclearCookie
Copy link

I'm guessing my empty firebase project doesn't have the admin SDK setup yet. Trying to figure that out now:
https://firebase.google.com/docs/admin/setup

@NuclearCookie
Copy link

Getting a little stuck here, I think I need to somehow have an existing backend as the firebase project.
I'll wait for a response before continuing :)
Great contributions so far, this will make it way easier to contribute in the future!

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.

2 participants