Updating Production S3 with latest icog-books#289
Conversation
….json-branch! Formatting Content.json for Hausa books!
…ausa-Books! Updating TimeStamps for hausa books!
* feat: Create .coderabbit.yaml for auto reviews * fix: parsing error in .coderabbit.yaml
Adding Automation scripts for checking unused files and missing files!
* feat: add first GDL book * feat: add stragety for the GDL and H5P book loaders * feat: add service worker support for the GDL book content caching * feat: App, index, wb config updates and sw regeneration
* feat: add first GDL book * feat: add stragety for the GDL and H5P book loaders * feat: add service worker support for the GDL book content caching * feat: App, index, wb config updates and sw regeneration * fix: dev environment only fixes
* feat: add first GDL book * feat: add stragety for the GDL and H5P book loaders * feat: add service worker support for the GDL book content caching * feat: App, index, wb config updates and sw regeneration * fix: dev environment only fixes * feat: add the landscape enforcement for the gdl books
feat: Adding ChakusCycleFrench interactive book
feat: Adding Colours French Interactive book
feat: Adding DadsBootsFrench Interactive book
feat: Adding FirendsFrench interactive book
feat: Adding FrogsStarryWishFrench interactive book
feat: Adding PlaygroundFrench interactive book
feat: Adding TallAndShortFrench interactive book
feat: Adding TheLionRunsAndTheCowWalksFrench interactive book
feat: Adding WhatDayIsItFrench interactive book
feat: Adding WhoCanHelpMeFrench interactive book
* feat: add first GDL book * feat: add stragety for the GDL and H5P book loaders * feat: add service worker support for the GDL book content caching * feat: App, index, wb config updates and sw regeneration * fix: dev environment only fixes * feat: add the landscape enforcement for the gdl books * feat: add 2 more GDL books
* feat: add first GDL book * feat: add stragety for the GDL and H5P book loaders * feat: add service worker support for the GDL book content caching * feat: App, index, wb config updates and sw regeneration * fix: dev environment only fixes * feat: add the landscape enforcement for the gdl books * feat: add 2 more GDL books * fix: delete the od gdlplayer * fix: gdlplayer upgrade for the ilovemymomen1 book
* feat: add first GDL book * feat: add stragety for the GDL and H5P book loaders * feat: add service worker support for the GDL book content caching * feat: App, index, wb config updates and sw regeneration * fix: dev environment only fixes * feat: add the landscape enforcement for the gdl books * feat: add 2 more GDL books * fix: delete the od gdlplayer * fix: gdlplayer upgrade for the ilovemymomen1 book * feat: book updates and service worker caching fixes/refactors
|
Warning Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories. 📝 WalkthroughWalkthroughCircleCI S3 sync jobs gain explicit bucket targets, completion messages, and a new partner-sync job with branch-based routing. The CodeRabbit configuration is rewritten to a newer schema covering reviews, path filters, pre-merge checks, and chat. App.ts exports several previously private helpers, activates Firebase session logging, bumps the app version, and replaces direct App instantiation with a BookLoader factory selecting GdlBookLoader or CrBookLoader. ChangesCircleCI S3 Sync Updates
CodeRabbit Configuration Rewrite
App.ts Loader Refactor and Firebase Session Logging
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AppTs
participant createBookLoader
participant GdlBookLoader
participant CrBookLoader
AppTs->>createBookLoader: bookName
createBookLoader->>GdlBookLoader: return if prefix gdl-
createBookLoader->>CrBookLoader: return otherwise
AppTs->>GdlBookLoader: load()
AppTs->>CrBookLoader: load()
Possibly related PRs
Suggested reviewers: `dz4va` 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
.circleci/config.yml (2)
60-85: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winNew
s3-sync-partnerjob duplicates outdated Python image.The new job repeats
cimg/python:3.6, which is end-of-life (Python 3.6 support ended in Dec 2021). Since this build environment isn't actually running Python code (just AWS CLI sync via the orb), this is mostly a supply-chain/security hygiene concern (unpatched base image) rather than a functional one, but worth bumping alongside the other two jobs while you're touching this file.♻️ Suggested image bump
s3-sync-partner: docker: - - image: "cimg/python:3.6" + - image: "cimg/python:3.11"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.circleci/config.yml around lines 60 - 85, The new s3-sync-partner job is using the outdated cimg/python:3.6 base image, so update the docker image in the s3-sync-partner job to match the newer image used by the other sync jobs. Keep the aws-s3/sync step and its settings unchanged; only replace the obsolete Python 3.6 runtime reference in the job definition.
6-85: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSignificant duplication across the three sync jobs.
s3-sync-development,s3-sync-production, and the news3-sync-partnerare near-identical copies differing only in bucket URL, region variable, and echo text. Consider a parameterized CircleCI job (or YAML anchors) to avoid triple-maintaining the same steps/args when exclusions or ACL settings need to change in the future.♻️ Example parameterized job sketch
+jobs: + s3-sync: + parameters: + bucket: + type: string + region_env: + type: env_var_name + default: AWS_DEFAULT_REGION + docker: + - image: "cimg/python:3.11" + steps: + - checkout + - run: + name: Pre-sync Setup + command: echo "Setting up for S3 sync to <<parameters.bucket>>" + - aws-s3/sync: + arguments: | + --acl public-read \ + --cache-control "max-age=86400" \ + --exclude ".git/*" \ + --exclude ".gitignore" \ + --exclude ".gitattributes" + aws-access-key-id: AWS_ACCESS_KEY + aws-region: <<parameters.region_env>> + aws-secret-access-key: AWS_SECRET_ACCESS_KEY + from: ./ + to: "s3://<<parameters.bucket>>" + - run: + name: Post-sync Confirmation + command: echo "Sync to <<parameters.bucket>> S3 bucket completed."Then invoke in the workflow with different
bucket/region_envparams per branch.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.circleci/config.yml around lines 6 - 85, The three CircleCI jobs s3-sync-development, s3-sync-production, and s3-sync-partner duplicate the same checkout/run/aws-s3/sync steps with only the bucket, region, and log text changing. Refactor this into a single parameterized job or reusable YAML anchor in .circleci/config.yml, and pass bucket/region-specific values from the workflow so future changes to aws-s3/sync arguments or exclusions only need to be made once..coderabbit.yaml (2)
30-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExcluding all
**/*.jsondrops review coverage on meaningful config.The
!**/*.jsonfilter suppresses review of files likepackage.json,tsconfig.json, and Firebase/app config JSON — where dependency bumps or config changes can carry real risk. Consider excluding only large/generated JSON (e.g.package-lock.json, which you already list) rather than every JSON file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.coderabbit.yaml around lines 30 - 35, The path filter list is excluding every JSON file, which prevents review of important config like package.json, tsconfig.json, and app/firebase JSON. Update the path_filters in the .coderabbit.yaml config to stop blanket-excluding **/*.json and instead only ignore generated or large JSON files that should not be reviewed, keeping meaningful config files visible to code review.
22-27: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAnchor
base_branchesfor exact branch matches.base_branchesentries are regexes, sotest,develop, andmaincan match more than the intended branch names. Use^...$if these are meant to be exact.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.coderabbit.yaml around lines 22 - 27, The base_branches patterns are currently treated as regexes, so the plain entries in the base_branches list can match unintended branch names. Update the base_branches values in the configuration to use exact-match regex anchors for develop, test, and main, and keep the logic consistent with how the review selection matches branches.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@App.ts`:
- Around line 241-243: The startup flow in App.ts is ignoring the Promise
returned by loader.load(), so any loader rejection can become an unhandled
promise rejection. Update the App.initialize path around createBookLoader and
loader.load() to either await the call inside the existing async flow or attach
a .catch() that forwards the error into the same recovery/error handling used by
App.initialize, so failures from initializeGdlBook and other loaders are handled
consistently.
---
Nitpick comments:
In @.circleci/config.yml:
- Around line 60-85: The new s3-sync-partner job is using the outdated
cimg/python:3.6 base image, so update the docker image in the s3-sync-partner
job to match the newer image used by the other sync jobs. Keep the aws-s3/sync
step and its settings unchanged; only replace the obsolete Python 3.6 runtime
reference in the job definition.
- Around line 6-85: The three CircleCI jobs s3-sync-development,
s3-sync-production, and s3-sync-partner duplicate the same
checkout/run/aws-s3/sync steps with only the bucket, region, and log text
changing. Refactor this into a single parameterized job or reusable YAML anchor
in .circleci/config.yml, and pass bucket/region-specific values from the
workflow so future changes to aws-s3/sync arguments or exclusions only need to
be made once.
In @.coderabbit.yaml:
- Around line 30-35: The path filter list is excluding every JSON file, which
prevents review of important config like package.json, tsconfig.json, and
app/firebase JSON. Update the path_filters in the .coderabbit.yaml config to
stop blanket-excluding **/*.json and instead only ignore generated or large JSON
files that should not be reviewed, keeping meaningful config files visible to
code review.
- Around line 22-27: The base_branches patterns are currently treated as
regexes, so the plain entries in the base_branches list can match unintended
branch names. Update the base_branches values in the configuration to use
exact-match regex anchors for develop, test, and main, and keep the logic
consistent with how the review selection matches branches.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| // Create and use the appropriate loader based on the book type | ||
| const loader: BookLoader = createBookLoader(bookName); | ||
| loader.load(); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Handle rejection from the async loader.load().
load() returns a Promise<void>, but the returned promise is neither awaited nor given a .catch(). Any rejection escaping the loaders (e.g., before App.initialize's internal try/catch, or from initializeGdlBook) surfaces as an unhandled promise rejection with no user-facing recovery on the startup path.
🛡️ Proposed fix
// Create and use the appropriate loader based on the book type
const loader: BookLoader = createBookLoader(bookName);
-loader.load();
+loader.load().catch((error) => {
+ console.error("Failed to load book:", error);
+});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Create and use the appropriate loader based on the book type | |
| const loader: BookLoader = createBookLoader(bookName); | |
| loader.load(); | |
| // Create and use the appropriate loader based on the book type | |
| const loader: BookLoader = createBookLoader(bookName); | |
| loader.load().catch((error) => { | |
| console.error("Failed to load book:", error); | |
| }); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@App.ts` around lines 241 - 243, The startup flow in App.ts is ignoring the
Promise returned by loader.load(), so any loader rejection can become an
unhandled promise rejection. Update the App.initialize path around
createBookLoader and loader.load() to either await the call inside the existing
async flow or attach a .catch() that forwards the error into the same
recovery/error handling used by App.initialize, so failures from
initializeGdlBook and other loaders are handled consistently.
Summary by CodeRabbit