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(totalPreviewChannelLimit): add option to manage preview channels to avoid hitting the channel quota #397

Conversation

weilinzung
Copy link
Contributor

@weilinzung weilinzung commented Nov 30, 2024

Part of the solution for #60

  • I also would like to make another PR to solve the above issue once this is approved and merged, like the "removeChannel" would be useful.
  • Also, the existing "pre-commit" hooks don't really work, made improvement and fix the issue

What’s Changed:

  1. Added totalPreviewChannelLimit Input Option:

    • Where: action.yml, README.md
    • I added a new input to control the number of preview channels Firebase Hosting will use. By setting the totalPreviewChannelLimit, you can avoid hitting the hosting quota limit (currently set at 50 channels).
    • Once the limit is hit, older preview channels get automatically removed, preventing errors like "channel quota reached."
  2. New Function for Managing Preview Channels:

    • Where: src/deploy.ts
    • Introduced the getAllChannels function to list all active preview channels in the Firebase project, making it easier to track the quota.
    • Added removePreviews, which removes older preview channels when the totalPreviewChannelLimit is reached. It uses the removeChannel function to delete specific channels.
    • The removeChannel function allows the deletion of specific preview channels by their ID, helping manage the number of active channels.
  3. Docs Updates:

    • Where: README.md, action.yml
    • We updated the documentation to include the new totalPreviewChannelLimit option, explaining how to set it up and how it interacts with Firebase Hosting’s limits.

Why This Matters:

The goal of this change is to give you more control over Firebase Hosting preview channels. Now, you can prevent hitting the 50-channel limit by automatically cleaning up older channels when necessary, saving you from unexpected errors in your deployment process.

@weilinzung
Copy link
Contributor Author

After a couple of tries with the failed CI, I found that I shouldn't need to worry about those failed. It is good to review!

@weilinzung
Copy link
Contributor Author

@jhuleatt I wanted to kindly ask for your review. It is very useful for us since we have a Monorepo setup with a couple of web apps and shared codes, so the affected deploying frequency is high for us.

@weilinzung
Copy link
Contributor Author

close this for #400

@weilinzung weilinzung closed this Dec 10, 2024
@FirebaseExtended FirebaseExtended locked and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant