Skip to content

Mono Repo vs. Centralised GitHub Actions vs. Hybrid #266

Open

Description

@mmcky

Issue: Evaluate Lecture Repository Architecture Approaches

Summary

This issue documents a comparison of two architectural approaches for managing QuantEcon lecture repositories, with the goal of improving maintainability, consistency, and authoring experience across lecture series.

Context: Rolling out updates across lectures (theme improvements, exercise extensions, common static assets like GPU admonitions) currently requires coordinating changes across multiple repositories. This creates maintenance overhead and risks inconsistency.


Option 1: Mono Repository

Consolidate all lectures into a single repository, with lecture series managed via configuration files (e.g., lecture-python-programming.yml). Publishing would still push outputs to individual repositories for hosting via GitHub Pages.

Pros

Benefit Description
Single source of truth All lecture content in one place; updates propagate naturally
Simplified lecture reuse Easier to include the same lecture in multiple series without duplication
Centralized testing Execution testing runs from one location; can specialize hardware requirements as needed
Consistent tooling Build scripts, linting, and CI configuration maintained once
Atomic cross-series updates Theme changes, admonitions, and shared assets updated in a single commit

Cons

Challenge Description
Scale and navigation Large number of lectures to navigate; finding relevant files becomes harder
Loss of series context No direct mental model of how a series is organized; editing happens "out of context"
Publishing complexity Still requires individual repositories for GitHub Pages hosting
Variant management Harder to manage specialized versions (e.g., JAX variants) without naming conventions like _jax suffixes
Longer CI runtimes Execution testing across all lectures increases total runtime
Contributor onboarding New contributors may find the repo overwhelming

Key Concern

From an authoring perspective, it's unclear how to quickly identify how a lecture fits within a series (narrative flow, prerequisites, learning progression). Series tags in YAML frontmatter help, but may not provide sufficient context for effective authoring.


Option 2: Centralized GitHub Actions

Maintain separate repositories for each lecture series, but centralize all workflow complexity (environments, build processes, publishing) via shared GitHub Actions maintained in a central repository (e.g., QuantEcon/actions).

Pros

Benefit Description
Series-level organization Source of truth remains at the series level; clear mental model for authors
Focused repositories Each repo contains only relevant lectures; easier navigation
Centralized infrastructure Environments, publishing config, and build logic updated once and used everywhere
Isolated CI Faster test runs per repository; failures are scoped to a single series
Familiar contributor model Contributors work within a focused, understandable scope

Cons

Challenge Description
Lecture sharing Harder to use lectures across series; requires tracking source of truth and syncing
Action versioning Coordinating action updates across repos; managing breaking changes
Drift risk Individual repos may drift from centralized patterns if not kept in sync
Duplication Shared content (admonitions, includes) may need to be duplicated or fetched at build time

Current Status

This approach is actively being developed in QuantEcon/actions. See also: lecture-jax#256 as an example of deployment architecture that needs updating.


Option 3: Hybrid Approach (for consideration)

A potential middle ground: maintain a mono repository as the source of truth, with series repositories kept in sync for authoring contributions.

Concept

  • Mono repo serves as the canonical source and handles cross-series concerns
  • Series repos are synchronized views that provide authoring context
  • Changes can flow bidirectionally (or from series → mono with automation)

Open Questions

  • What tooling would be needed to keep repos in sync?
  • How would conflicts be resolved?
  • Does this add complexity without sufficient benefit?

Evaluation Criteria

When deciding between approaches, consider:

  1. Author experience — How easy is it to understand context and make changes?
  2. Maintainability — How much effort to keep infrastructure consistent?
  3. Scalability — How well does it handle growing number of lectures/series?
  4. Contributor accessibility — How approachable is it for new contributors?
  5. CI/CD efficiency — Build times, resource usage, failure isolation
  6. Content reuse — How easily can lectures be shared across series?

Next Steps

  • Gather feedback from team on priorities and pain points
  • Evaluate feasibility of hybrid approach
  • Prototype if needed
  • Make decision and document rationale

References


Initial discussion between @jstac and @mmcky, December 2024

Activity

  1. mmcky commented on Dec 1, 2025

    @mmcky
    ContributorAuthor

    Recommendation (via GitHub Copilot analysis)

    Based on the analysis in this issue, the recommendation is Option 2: Centralized GitHub Actions, with a path toward selective elements of the hybrid approach over time.


    Reasoning

    Why not the Mono Repo (Option 1)?

    The authoring experience concern is significant. When writing educational content, understanding the narrative flow—what comes before, what comes after, what concepts have been introduced—is critical. A flat structure with 100+ lectures makes this cognitively difficult, even with good tooling. Educational content isn't like a typical codebase where files are relatively independent; lectures are deeply interconnected within a series.

    Why Centralized Actions (Option 2)?

    1. Preserves the mental model — Authors think in terms of series, and the repo structure matches that mental model. This reduces friction and errors.

    2. Solves the actual pain point — The original concern was about rolling out infrastructure updates (themes, admonitions, deployment). Centralized actions directly address this without disrupting content organization.

    3. Lower risk — Work is already underway in QuantEcon/actions. It's an incremental improvement rather than a major migration.

    4. Failure isolation — A broken build in one series doesn't block others. This matters for a project with multiple active lecture series.

    Addressing the main weakness

    The biggest con of Option 2 is lecture sharing across series. However:

    • This is a relatively rare need compared to the daily authoring workflow
    • When needed, it can be solved with targeted tooling (e.g., a sync action that pulls specific lectures from a "shared" source)
    • The hybrid approach's "shared content fetched at build time" could be added incrementally

    Practical Path Forward

    1. Continue developing centralized actions — Focus on environments, build, and publishing workflows
    2. Create a shared assets mechanism — A small repo or folder for cross-series content (admonitions, common includes) that gets pulled at build time
    3. Document the lecture sharing workflow — When a lecture needs to appear in multiple series, establish a clear source-of-truth convention

    This gives you 80% of the mono repo benefits (consistency, single updates) while preserving the authoring experience that makes educational content easier to write and maintain.


    This recommendation was generated by GitHub Copilot (Claude Opus 4.5) based on the pros/cons analysis in this issue. It represents an AI-assisted evaluation and should be reviewed by the team.

  2. mmcky commented on Dec 1, 2025

    @mmcky
    ContributorAuthor

    Follow-up: Acknowledging Bias in the Recommendation

    The previous recommendation toward Option 2 was heavily influenced by the framing in the initial notes, which already leaned in that direction by:

    1. Emphasizing the authoring concern as "the biggest concern" for the mono repo
    2. Describing Option 2 as providing an "easier mental model" for authoring
    3. Noting that Option 2 is already being actively developed

    To provide a more balanced view, here are scenarios where Option 1 (Mono Repo) might actually be the better choice:

    • If lecture reuse across series becomes frequent (e.g., foundational Python lectures appearing in 3+ series)
    • If infrastructure drift proves hard to control even with centralized actions
    • If the team finds that series-level repos create silos that slow down cross-series improvements
    • If a good IDE/tooling solution emerges for navigating mono repos with series context (e.g., VS Code workspace views filtered by series tags)

    Key Questions the Team Should Answer

    1. How often are lectures actually shared across series today? If it's common, the mono repo's reuse benefits become more valuable.
    2. How painful is current multi-repo maintenance? If drift and inconsistency are major time sinks, a mono repo might be worth the authoring trade-off.
    3. How does the team actually work day-to-day? Do authors work on one series at a time, or frequently jump between series?

    These real-world factors should drive the decision more than a theoretical analysis of written pros/cons.


    Follow-up from GitHub Copilot (Claude Opus 4.5) acknowledging that the initial recommendation reflected bias in the input framing.

  3. mmcky commented on Dec 1, 2025

    @mmcky
    ContributorAuthor

    @kp992 do you remember any other pros/cons re: mono repo idea that we have discussed?

  4. changed the title [-]Evaluate Lecture Repository Architecture Approaches[/-] [+]Mono Repo vs. Centralised GitHub Actions vs. Hybrid[/+] on Dec 2, 2025
  5. kp992 commented on Dec 8, 2025

    @kp992

    Thanks for putting this together @mmcky. For option 1, I think almost everything is covered so don't have much to add. For option 1 cons:

    • Longer CI runtimes: We could optimize the testing/CI by writing the testing script path-aware. We will only build the lectures that gets affected by the diff in the PR which makes the testing time similar or even better than we have currently.
    • Publishing complexity: We can write cron jobs that run every hour or every six hours or even manually trigger that can push down the lectures updates to the individual series repositories. It's like polling the monorepo on regular intervals to see any changes in the *-series.yaml lecture files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions