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

Improve Development Documentation #53

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

Conversation

GabLeRoux
Copy link
Member

@GabLeRoux GabLeRoux commented Oct 1, 2024

This pull request includes significant updates to the documentation, particularly enhancing the DEVELOPMENT.md guide and the README.md file. The changes aim to provide clearer instructions and a more comprehensive overview of the project's setup, deployment, and functionality.

Documentation Enhancements:

  • Development Guide:

    • Renamed the file from # Development to # Development Guide and added a detailed table of contents.
    • Expanded sections on setting up the development environment, including installing Firebase CLI, project dependencies, and running the project locally.
    • Added detailed instructions for deploying the project to Firebase, including logging in and deploying specific services.
    • Included optional setup for Firebase Admin SDK with environment variable configuration for Linux/MacOS and Windows.
    • Provided a thorough guide on setting up integrations and environment variables for Discord and GitHub.
    • Added sections on updating configuration variables in Firebase and troubleshooting tips.
  • README Overview:

    • Added an overview of the GameCI Versioning Backend, explaining its purpose and integration with GitHub and Discord.
    • Detailed the backend's functionality for ingesting Unity versions and GameCI Docker versions, including scraping Unity's version archive and scheduling CI build jobs.
    • Explained the scheduler's role in managing CI jobs and builds, including status tracking and notifications.
    • Provided instructions for backing up and restoring the Firestore database using the backfire tool.
    • Linked to the updated DEVELOPMENT.md for further development instructions.

I went forward and tried to improve the docs. I wrote this after seing a user mentionning they couldn't find the docs on how to work with this project after looking at the readme. There is now a link to DEVELOPMENT.md at the end of the ReadMe.

You can see the results here:

Summary by CodeRabbit

  • Documentation
    • Restructured and enhanced DEVELOPMENT.md to improve clarity and usability, including new sections on prerequisites, setup, deployment, and troubleshooting.
    • Updated README.md to provide a clearer overview of the GameCI Versioning Backend's functionalities, including detailed descriptions of automation processes and integration capabilities.
    • Added sections on development setup and contributing guidelines to README.md.

Copy link
Member

@davidmfinol davidmfinol left a comment

Choose a reason for hiding this comment

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

This is actually great as a refresher for me too

```
export internal.token="my_internal_token"
```bash
export INTERNAL_TOKEN="your_internal_token"
Copy link
Member Author

Choose a reason for hiding this comment

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

I found it weird to have dots in these values, but this is probably going to break things. 🤔 Is this a special syntax for firebase functions configuration?

I would appreciate if someone could confirm this one so we can go forward with merging the rest of it 🙏

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I pretty much confirmed this by reading the code.

functions/src/api/testFunction.ts
12:const internalToken = defineSecret('INTERNAL_TOKEN');

functions/src/api/reportNewBuild.ts
14:const internalToken = defineSecret('INTERNAL_TOKEN');

functions/src/api/reportPublication.ts
12:const internalToken = defineSecret('INTERNAL_TOKEN');

functions/src/api/reportBuildFailure.ts
11:const internalToken = defineSecret('INTERNAL_TOKEN');

DEVELOPMENT.md
147:export INTERNAL_TOKEN="your_internal_token"

I'm quite sure the syntax when working locally with export is to use INTERNAL_TOKEN instead of internal.token.

```
- **Start Specific Emulators Only:** To run specific components (e.g., `functions` only):
```bash
firebase emulators:start --only functions
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if this will work, but working with firebase emulators is most likely a good approach to working locally with this project. Feedback would be appreciated here.

Copy link
Member

@webbertakken webbertakken Oct 7, 2024

Choose a reason for hiding this comment

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

The thing is that in order to create a proper dev workflow you'd have to mock the dispatching github actions (for the building of images) from the cronjob, or skip the cronjob altogether (at which point the emulators don't do much at all).

@GabLeRoux
Copy link
Member Author

I added some comments which I forgot to hit submit as a self review. I would appreciate if someone can give it a try and confirm if the commands are ok. I will give it a try too shortly

DEVELOPMENT.md Outdated Show resolved Hide resolved
@GabLeRoux GabLeRoux changed the title Improve documentation Improve Development Documentation Oct 3, 2024
@GabLeRoux
Copy link
Member Author

@coderabbitai full review

Copy link

coderabbitai bot commented Oct 25, 2024

✅ Actions performed

Full review triggered.

Copy link

coderabbitai bot commented Oct 25, 2024

Walkthrough

The changes involve a comprehensive restructuring and enhancement of the DEVELOPMENT.md and README.md documents. The DEVELOPMENT.md file has been renamed to "Development Guide" and now includes a table of contents and several new sections to improve organization and clarity. Similarly, the README.md file has undergone significant updates to its section headers and content, providing a clearer overview of functionalities related to the GameCI Versioning Backend. Both documents aim to enhance usability for developers.

Changes

File Change Summary
DEVELOPMENT.md Title changed to "Development Guide"; added sections: Prerequisites, Setup, Deployment, Optional Local Setup for Firebase Admin SDK, Integrations & Environment Variables, Updating Configuration Variables in Firebase, Local Development Commands, Troubleshooting & Tips, Contributing. Expanded setup instructions and clarified deployment steps.
README.md Restructured with updated section headers; replaced "Unity version ingest" with "Overview"; renamed and expanded "game-ci/docker version ingest" to "GameCI/Docker Version Ingest"; modified "Scheduler" section for clarity; updated "Ingeminator" description; clarified database backup instructions and added restore command; added Development and Contributing sections.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant DevelopmentGuide
    participant README
    Developer->>DevelopmentGuide: Access Development Guide
    DevelopmentGuide-->>Developer: Provides setup and deployment instructions
    Developer->>README: Access README
    README-->>Developer: Provides overview and functionalities
Loading

🐇 "In the guide, we hop and play,
To set up projects in a clearer way.
With sections bright and tips galore,
Developers will find what they explore.
From Firebase to Docker, all aligned,
In this new guide, clarity you'll find!" 🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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 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

@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

🧹 Outside diff range and nitpick comments (11)
README.md (7)

1-9: Consider enhancing the introduction with badges and quick links.

The introduction provides a clear overview, but could be more informative with:

  • Status badges (build status, version, license)
  • Quick links to key sections (setup, deployment, contributing)
  • Link to the live service or demo if available

11-18: Consider adding a data structure example.

The Unity Version Ingest section clearly explains the process. Consider adding an example of how the version data is structured in Firestore to help developers understand the data model.


22-24: Enhance the Docker Version Ingest section with more details.

Consider:

  • Simplifying "in conjunction with" to "alongside"
  • Adding details about:
    • How often versions are checked
    • Where the versions are sourced from
    • Example of the version format
🧰 Tools
🪛 LanguageTool

[style] ~24-~24: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...cker images. These versions are tracked in conjunction with Unity versions, ensuring Docker images ...

(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)


34-38: Add language specification to the code block.

Specify the language for the code block to enable syntax highlighting.

-    ```
+    ```text
🧰 Tools
🪛 Markdownlint

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

(MD040, fenced-code-language)


35-37: Clarify the version placeholder usage.

Consider adding a note explaining what <version> represents in these examples and its possible values.


48-50: Documentation needed for the Ingeminator section.

The section indicates that documentation is pending. Consider adding:

  • Retry logic and conditions
  • Maximum retry attempts
  • Failure handling strategy

Would you like me to help draft detailed documentation for the Ingeminator section?


56-72: Add safety warnings for database operations.

Consider adding important warnings:

  • Backup verification steps
  • Production data handling precautions
  • Required permissions for backup/restore operations
DEVELOPMENT.md (4)

5-27: Maintain consistent unordered list style in TOC.

The table of contents uses asterisks for list items. For consistency with the rest of the document and markdown best practices, consider using dashes instead.

-* [Development Guide](#development-guide)
-  * [Prerequisites](#prerequisites)
-  * [Setup](#setup)
+- [Development Guide](#development-guide)
+  - [Prerequisites](#prerequisites)
+  - [Setup](#setup)
🧰 Tools
🪛 LanguageTool

[grammar] ~17-~17: The operating system from Apple is written “macOS”.
Context: ...etting-up-credentials) * Linux / MacOS * [Windows (Power...

(MAC_OS)


109-109: Update OS name to use correct spelling.

The Apple operating system should be written as "macOS" instead of "MacOS" in the section headers.

-#### Linux / MacOS
+#### Linux / macOS

Also applies to: 115-115

🧰 Tools
🪛 LanguageTool

[grammar] ~109-~109: The operating system from Apple is written “macOS”.
Context: ...to the path of this file. #### Linux / MacOS ```bash export GOOGLE_APPLICATION_CRED...

(MAC_OS)


158-162: Consider adding validation steps for config variables.

While the configuration commands are correct, it would be helpful to add instructions for verifying that the variables were set correctly:

 firebase functions:config:set discord.token="your_discord_token"
 firebase functions:config:set github.client-secret="your_github_app_client_secret"
 firebase functions:config:set github.private-key="your_github_app_private_key"
 firebase functions:config:set internal.token="your_internal_token"
+
+# Verify the configuration
+firebase functions:config:get

186-190: Consider expanding troubleshooting section.

The troubleshooting section could be more helpful with specific examples of common issues and their solutions, such as:

  • Error messages when environment variables are missing
  • Common Firebase emulator issues
  • Debugging integration problems

Would you like me to help generate more detailed troubleshooting examples?

🧰 Tools
🪛 Markdownlint

188-188: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


189-189: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e3d917f and 264c4ad.

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

[grammar] ~17-~17: The operating system from Apple is written “macOS”.
Context: ...etting-up-credentials) * Linux / MacOS * [Windows (Power...

(MAC_OS)


[grammar] ~109-~109: The operating system from Apple is written “macOS”.
Context: ...to the path of this file. #### Linux / MacOS ```bash export GOOGLE_APPLICATION_CRED...

(MAC_OS)

README.md

[style] ~24-~24: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...cker images. These versions are tracked in conjunction with Unity versions, ensuring Docker images ...

(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)

🪛 Markdownlint
DEVELOPMENT.md

33-33: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


34-34: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


169-169: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


174-174: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


179-179: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


188-188: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


189-189: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

README.md

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

(MD040, fenced-code-language)

🔇 Additional comments (4)
README.md (1)

76-84: LGTM! Clear and welcoming development and contribution sections.

The sections provide appropriate links to detailed documentation and encourage contributions effectively.

DEVELOPMENT.md (3)

29-69: LGTM! Clear and accurate setup instructions.

The setup instructions are well-structured and follow the agreed-upon practice of using npm for global installations while using yarn for project dependencies.

🧰 Tools
🪛 Markdownlint

33-33: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


34-34: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


70-99: LGTM! Comprehensive deployment guide.

The deployment instructions are clear and include both full and selective deployment options with proper examples.


125-153: LGTM! Clear environment variable configuration.

The environment variables section provides clear instructions for setting up all necessary integrations.

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.

3 participants