Skip to content

docs: align the README with the other apps - #429

Merged
uniqueg merged 4 commits into
devfrom
docs/readme-alignment
Oct 23, 2026
Merged

uniqueg merged 4 commits into
devfrom
docs/readme-alignment

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #426 (base is dev, so the issue is closed by hand after the merge).

  • README.md now has the structure and style of Cloud Registry's and proTES's READMEs:

    • the ELIXIR On-Cloud logo, the title, and the same badge set plus PyPI;
    • a synopsis ("brought to you by ELIXIR On-Cloud") that lists what FOCA provides;
    • a link to the documentation, including the migration guides (0.17.0 first);
    • "Why FOCA", with measured numbers given as ranges and a note that the savings add up over several apps;
    • "Apps built with FOCA" (Cloud Registry, proTES);
    • a quick start and contributing.

    All links and images are absolute, because the README is also the PyPI project page. The old logos at the bottom are removed (images/logo-banner.svg, images/foca_logo_192px.png), as are the License, Contact, Versioning, Releasing and Docker image sections.

  • docs/index.md includes the README's synopsis, "Why FOCA" and app sections via pymdownx.snippets, as Cloud Registry's docs do, so the overlap can't drift. The page also has a Contents list, License and Contact.

  • Moved content:

    • Versioning and releasing are now "Versioning and releases" in docs/contributing.md.
    • The image tag scheme is now under "Docker" in docs/getting-started.md.
    • References to the old README sections are updated: pyproject.toml, the release.yml and scan.yml comments, and the contributing guide.
    • Two example READMEs linked a README anchor that no longer exists; they now point to the configuration docs.

The numbers

The counts are code lines: lines spanned by any Python token except comments and line breaks (via tokenize), so blank lines and comments are excluded and docstrings are included. Chart files count non-blank lines that are not # or {{/* */}} comments. Rendered test snapshots are excluded. Measured on FOCA dev (this branch, merged with a629254) and Cloud Registry dev (f4a8acd).

What Lines
FOCA package (foca/**/*.py) 9,312
of which Cloud Registry does not use: factories/celery_app.py, utils/db.py 97
FOCA tests (tests/**/*.py) 12,635
foca-common chart (templates, schema, Chart.yaml) 1,768
Cloud Registry's own code (cloud_registry/**/*.py) 2,220
Cloud Registry's tests (tests/**/*.py) 9,023
  • Code only: 2,220 / (2,220 + 9,215) ≈ 19%, so "about a fifth".
  • Code and tests: (2,220 + 9,023) / (2,220 + 9,023 + 9,215 + 12,635) ≈ 34%, so "about a third".
  • Conservative bound: if an app needed only half of FOCA's package, it would still save about 4,650 lines; the README says "about 4,500".

Script (count_sloc.py):

import io, re, sys, tokenize
from pathlib import Path

SKIP = {tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE, tokenize.INDENT,
        tokenize.DEDENT, tokenize.ENCODING, tokenize.ENDMARKER}
SUFFIXES = {".py", ".yaml", ".yml", ".tpl", ".json", ".conf", ".txt"}
TPL_COMMENT = re.compile(r"^\{\{-?\s*/\*.*\*/\s*-?\}\}$")

def python_lines(text):
    lines = set()
    for tok in tokenize.generate_tokens(io.StringIO(text).readline):
        if tok.type not in SKIP:
            lines.update(range(tok.start[0], tok.end[0] + 1))
    return len(lines)

def other_lines(text):
    count, in_comment = 0, False
    for raw in text.splitlines():
        line = raw.strip()
        if in_comment:
            in_comment = "*/" not in line
            continue
        if not line or line.startswith("#") or TPL_COMMENT.match(line):
            continue
        if re.match(r"^\{\{-?\s*/\*", line):
            in_comment = "*/" not in line
            continue
        count += 1
    return count

def count(path):
    files = [path] if path.is_file() else sorted(
        p for p in path.rglob("*")
        if p.is_file() and p.suffix in SUFFIXES and "__pycache__" not in p.parts
        and "__snapshots__" not in p.parts)
    return sum(python_lines(f.read_text()) if f.suffix == ".py"
               else other_lines(f.read_text()) for f in files)

total = 0
for arg in sys.argv[1:]:
    n = count(Path(arg)); total += n; print(f"{n:6d}  {arg}")
print(f"{total:6d}  total")

Commands (from the parent directory of both clones):

python count_sloc.py $(find foca/foca -name '*.py')
python count_sloc.py foca/foca/factories/celery_app.py foca/foca/utils/db.py
python count_sloc.py $(find foca/tests -name '*.py')
python count_sloc.py foca/charts/foca-common/templates foca/charts/foca-common/values.yaml \
    foca/charts/foca-common/app-values.schema.json foca/charts/foca-common/Chart.yaml
python count_sloc.py $(find cloud-registry/cloud_registry -name '*.py')
python count_sloc.py $(find cloud-registry/tests -name '*.py')

Note: Cloud Registry's YAML specs and config (1,341 more lines) are not counted as its own code. proTES (2,841 lines of code) still uses FOCA 0.15, so it is not used for the numbers.

Verification

  • pre-commit run --all-files: all hooks passed.
  • mkdocs build --strict: passed. The index page renders the README's sections.
  • python -m build and twine check --strict dist/*: both passed. With readme_renderer[md], the rendered long description has only absolute image and link URLs.
  • CI: all checks passed (incl. Read the Docs preview build).

Declined review findings

The quality reviewer found nothing high or medium. Declined low findings:

  • Label "FOCA 0.17.0" before the tag exists. Declined: this README ships to PyPI with the 0.17.0 release, which is planned for tonight.
  • Delete images/foca_logo.svg and images/foca_seal.svg. Declined: both were already unused before this PR, and they are brand assets that others may link to. The FOCA logo that this PR made unused (docs/images/foca_logo.svg) is removed.
  • Single source for the migration links. Declined: the README paragraph and the index's Contents bullet have different forms.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Refresh the README and documentation structure to provide consistent, PyPI-compatible project guidance across FOCA and related applications.

New Features:

  • Align the README and documentation landing page with the ELIXIR On-Cloud application style, including shared synopsis, benefits, app listings, quick start guidance, badges, and migration links.

Bug Fixes:

  • Update example and project references that pointed to removed README anchors or outdated documentation sections.

Enhancements:

  • Centralize shared README content in the documentation using snippets to prevent drift.
  • Move versioning, release, and Docker image tag guidance into the appropriate documentation pages.
  • Use absolute README links and assets so the README renders correctly on PyPI.

Build:

  • Configure MkDocs to watch README content and validate snippet includes.

Documentation:

  • Refresh user-facing README and documentation navigation, and add license and contact information to the documentation landing page.

Chores:

  • Remove obsolete README logo assets and unused documentation imagery.

uniqueg and others added 3 commits October 23, 2026 04:48
Give the README the structure of Cloud Registry's and proTES's: the
ELIXIR On-Cloud logo, title, the same badge set (plus PyPI), a synopsis
with what FOCA provides, a "why FOCA" section with measured line counts,
the apps built with FOCA, a quick start and contributing. Links and
images are absolute, as the README is also the PyPI project page; the
old logos at the bottom are removed.

The docs' index page includes the synopsis, "why FOCA" and app sections
of the README (pymdownx.snippets), as Cloud Registry's does. Versioning
and releasing move to "Versioning and releases" in the contributing
guide, the image tags to "Docker" in Getting started; references to the
old README sections are updated.

Closes #426

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name exactly what Cloud Registry doesn't use of FOCA and state the two
fractions as two metrics; remove the FOCA logo that the docs' index no
longer uses and a stray backup of the hint icon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Aligns the README and documentation homepage with the other ELIXIR On-Cloud applications, using shared README snippets to prevent duplicated content from drifting, relocating release and Docker guidance into dedicated documentation, and repairing links and assets affected by the restructuring.

File-Level Changes

Change Details Files
Reworked the README into an app-aligned, PyPI-compatible project landing page.
  • Added ELIXIR On-Cloud branding, standardized badges, synopsis, documentation and migration links.
  • Added measured “Why FOCA” benefits, supported applications, quick start, and contributing sections.
  • Converted links and images to absolute URLs and removed obsolete sections and assets.
README.md
images/foca_logo_192px.png
images/logo-banner.svg
images/hint.svg.2021_02_16_09_54_34.0.svg
Made the documentation homepage reuse shared README content while adding navigation and project information.
  • Included README synopsis, benefits, and app sections through checked pymdownx snippets.
  • Added a contents list plus License and Contact sections.
  • Updated branding assets and removed the obsolete documentation logo.
docs/index.md
docs/images/logo_elixir_on_cloud.png
docs/images/foca_logo.svg
mkdocs.yml
Relocated operational project guidance into the relevant documentation pages.
  • Moved versioning and release procedures into the contributing guide.
  • Moved Docker image tag conventions into Getting Started.
  • Updated internal references to the new documentation locations.
docs/contributing.md
docs/getting-started.md
.github/workflows/release.yml
.github/workflows/scan.yml
pyproject.toml
Updated example documentation links to remain valid after README restructuring.
  • Replaced removed README configuration anchors with links to the configuration documentation.
examples/petstore/README.md
examples/petstore-access-control/README.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a629254) to head (ff5594f).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #429   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         2869      2869           
=========================================
  Hits          2869      2869           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review October 23, 2026 03:05

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="README.md" line_range="36" />
<code_context>
+- CORS and a [GA4GH service
+  info](https://github.com/ga4gh-discovery/ga4gh-service-info) endpoint;
+- Docker base images and a Helm library chart for Kubernetes, signed and with
+  SBOM and provenance attestations.
+<!-- --8<-- [end:synopsis] -->
+
</code_context>
<issue_to_address>
**Chart SBOM is unavailable**

When readers interpret the synopsis as promising an SBOM for the Helm chart, the synopsis says the chart has SBOM and provenance attestations, but the release workflow only signs the chart and attests provenance; chart users cannot find the promised SBOM.

Remove the claim that the Helm chart has an SBOM.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: README.md:36


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread README.md Resolved
Only the images come with an SBOM; the chart has a provenance
attestation and a signature.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@uniqueg
uniqueg merged commit 2c0cfa6 into dev Oct 23, 2026
22 checks passed
@uniqueg
uniqueg deleted the docs/readme-alignment branch October 23, 2026 03:15
uniqueg added a commit that referenced this pull request Oct 23, 2026
Resolve the conflicts with #429, which moved the release steps from
the README to "Versioning and releases" in the contributing guide:
describe the scan-before-sign flow there, and point the release
workflow's header to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant