Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
subversion=1.14.5-3 && \
rm -rf /var/lib/apt/lists/*

# Install LaTeX for PDF documentation generation
# texlive packages follow the TeX Live release cycle and are not pinned
RUN apt-get update && apt-get install --no-install-recommends -y \
texlive-latex-recommended \
texlive-fonts-recommended \
texlive-latex-extra \
latexmk && \
rm -rf /var/lib/apt/lists/*
Comment on lines +18 to +25
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if Debian provides year-specific TeX Live packages that could be pinned

# Search for available texlive packages in Debian Trixie repositories
curl -s "https://packages.debian.org/search?keywords=texlive&searchon=names&suite=trixie&section=all" | \
  grep -oP 'texlive-[0-9]{4}' | sort -u || echo "No year-specific TeX Live packages found"

# Alternative: Check if the current approach causes reproducibility issues
echo "Current approach: TeX Live packages unpinned to avoid version conflicts"
echo "Tradeoff: Builds may differ between environments/times"

Repository: dfetch-org/dfetch

Length of output: 187


The unpinned TeX Live packages approach is justified by Debian's constraints.

The LaTeX packages are intentionally installed without version pins to avoid build failures when Debian TeX Live package versions change. This is documented in the inline comment and consistent with the CI workflow. However, Debian does not provide year-specific TeX Live packages (e.g., texlive-2023) that could be pinned as an alternative.

Given this limitation, the current approach is reasonable. Consider documenting the reproducibility tradeoff in the project README or an Architecture Decision Record (ADR) so contributors understand that builds may vary slightly between environments or over time due to TeX Live updates.

Hadolint's DL3008 warning is valid for general container best practices, but this is an intentional exception justified by the TeX Live release cycle.

🧰 Tools
🪛 Hadolint (2.14.0)

[warning] 20-20: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>

(DL3008)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/Dockerfile around lines 18 - 25, Add documentation recording
the intentional decision to install TeX Live packages unpinned
(texlive-latex-recommended, texlive-fonts-recommended, texlive-latex-extra,
latexmk) and the reproducibility tradeoff, and note this as an explicit Hadolint
DL3008 exception; update the project README (or create an ADR) with a short
section that states why year-specific TeX Live packages can't be pinned on
Debian, that builds may vary over time, and that the Dockerfile's unpinned apt
installs are a deliberate choice to avoid build failures.


# Install ruby gem FPM for packaging
RUN apt-get update && apt-get install --no-install-recommends -y \
ruby=1:3.3+b1 \
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ jobs:
secrets: inherit

docs:
needs: prep-release
uses: ./.github/workflows/docs.yml
permissions:
contents: read
contents: write
secrets: inherit
with:
release_id: ${{ needs.prep-release.outputs.release_id }}
54 changes: 52 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: "Docs"

on:
workflow_call:
inputs:
release_id:
required: false
type: string
default: ''
Comment on lines +5 to +9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== docs workflow callers =="
rg -n -C3 'uses:\s*\.\/\.github\/workflows\/docs\.yml|release_id|prep-release' .github/workflows

echo
echo "== release_id producer =="
rg -n -C3 'outputs:|release_id|tag_name|upload_url|gh release|create[-_]release|action-gh-release' .github/workflows

Repository: dfetch-org/dfetch

Length of output: 248


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Files in .github/workflows =="
ls -la .github/workflows/ | head -20

echo
echo "== Content of docs.yml (full) =="
cat .github/workflows/docs.yml

echo
echo "== Search for callers of docs.yml =="
grep -r "docs.yml" .github/workflows/ || echo "No callers found"

echo
echo "== Search for prep-release workflow =="
if [ -f .github/workflows/prep-release.yml ]; then
  cat .github/workflows/prep-release.yml
else
  echo "prep-release.yml not found"
fi

Repository: dfetch-org/dfetch

Length of output: 4446


🏁 Script executed:

cat .github/workflows/ci.yml

Repository: dfetch-org/dfetch

Length of output: 1076


🏁 Script executed:

cat .github/workflows/release.yml

Repository: dfetch-org/dfetch

Length of output: 2784


🌐 Web query:

softprops/action-gh-release tag_name parameter documentation

💡 Result:

The tag_name parameter for the softprops/action-gh-release GitHub Action is an optional string input that specifies the name of the tag for the GitHub release. Description: "Name of a tag. defaults to github.ref_name. refs/tags/ values are normalized to ." When omitted, it defaults to the current GitHub ref name (e.g., the tag name from a push event). It can be used to create releases for custom or existing tags, such as in examples like tag_name: stage-2026-03-15. This is documented in the official README inputs table.

Citations:


Rename release_id to release_tag for clarity, since the value is a tag string not a numeric ID.

The variable named release_id in release.yml actually outputs a tag string (${{ steps.release_info.outputs.tag }}), not a numeric release ID. Using it as tag_name in the softprops/action-gh-release action is correct. However, the input should be renamed to release_tag to accurately reflect what it contains and avoid future confusion.

Also improve the condition from if: ${{ inputs.release_id }} to if: ${{ inputs.release_id != '' }} for clarity.

Suggested shape
-      release_id:
+      release_tag:
         required: false
         type: string
         default: ''
…
-        if: ${{ inputs.release_id }}
+        if: ${{ inputs.release_tag != '' }}
         uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.5.0
         with:
-          tag_name: ${{ inputs.release_id }}
+          tag_name: ${{ inputs.release_tag }}

Also applies to: lines 106-110

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/docs.yml around lines 5 - 9, Rename the workflow input
named release_id to release_tag and update all places that reference it (e.g.,
any if conditions and action inputs that pass it as tag_name to
softprops/action-gh-release); specifically change the input key release_id to
release_tag, replace uses of inputs.release_id with inputs.release_tag, and
change condition checks from if: ${{ inputs.release_id }} to if: ${{
inputs.release_tag != '' }} (and do the same for the second occurrence noted
around lines 106-110).


permissions:
contents: read
Expand All @@ -26,7 +31,6 @@ jobs:
- name: Install documentation requirements
run: |
pip install .[docs]
pip install sphinx_design

- name: Build docs
run: "make -C doc html"
Expand All @@ -50,7 +54,6 @@ jobs:
- name: Install dependencies
run: |
pip install .[docs]
pip install sphinx_design

- name: Build landing-page
run: "make -C doc/landing-page html"
Expand All @@ -63,3 +66,50 @@ jobs:
external_repository: dfetch-org/dfetch-org.github.io
publish_branch: main
deploy_key: ${{ secrets.GH_DFETCH_ORG_DEPLOY }}

pdf:
name: PDF Documentation
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'

- name: Install documentation requirements
run: |
pip install .[docs]

- name: Install LaTeX
run: |
sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended \
texlive-latex-extra latexmk
Comment on lines +92 to +95
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add apt-get update before installing LaTeX packages.

The apt-get install runs without a preceding apt-get update. On GitHub-hosted runners, the package cache can become stale, potentially causing package resolution failures.

Proposed fix
       - name: Install LaTeX
         run: |
-          sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended \
+          sudo apt-get update
+          sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended \
             texlive-latex-extra latexmk
📝 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.

Suggested change
- name: Install LaTeX
run: |
sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended \
texlive-latex-extra latexmk
- name: Install LaTeX
run: |
sudo apt-get update
sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended \
texlive-latex-extra latexmk
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/docs.yml around lines 92 - 95, The "Install LaTeX" GitHub
Actions step runs apt-get install without updating the package index; modify the
step named "Install LaTeX" in the run block so it executes a package index
refresh (e.g., run `sudo apt-get update`) immediately before the existing `sudo
apt-get install -y texlive-latex-recommended ... latexmk` command to ensure
package resolution succeeds on GitHub-hosted runners.


- name: Build PDF
run: make -C doc latexpdf

- name: Store PDF artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: dfetch-pdf-documentation
path: doc/_build/latex/dfetch-*.pdf

- name: Upload PDF to release
if: ${{ inputs.release_id }}
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.5.0
with:
tag_name: ${{ inputs.release_id }}
files: doc/_build/latex/dfetch-*.pdf
draft: true
preserve_order: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .plantwebrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"format": "png"}
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot Apr 1, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Global PNG output can break existing hardcoded .svg doc references.

This forces PlantWeb artifacts to .png, but doc/landing-page/index.rst (Line 374) still references static/patch-diagram.svg, which will become a broken asset path.

Suggested fix (update hardcoded extension)
--- a/doc/landing-page/index.rst
+++ b/doc/landing-page/index.rst
@@
-:file: static/patch-diagram.svg
+:file: static/patch-diagram.png

If you need mixed outputs by builder, consider making image references builder-aware instead of hardcoding one extension.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.plantwebrc at line 1, The project-level config (.plantwebrc) currently
forces PNG output via {"format":"png"}, which breaks hardcoded SVG references
like static/patch-diagram.svg in doc/landing-page/index.rst; either remove or
change the global format setting in .plantwebrc so it doesn't force PNG (e.g.,
delete the {"format":"png"} entry or set a builder-aware option), or if you must
keep PNG globally then update the hardcoded reference in
doc/landing-page/index.rst from static/patch-diagram.svg to
static/patch-diagram.png so the asset path matches the generated output.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The finding is a false positive — no fix needed.
static/patch-diagram.svg is a committed static asset in the repo. It's included via .. raw:: html :file: which just inlines the file content at build time — plantweb never touches it.
.plantwebrc only affects diagrams defined with .. uml:: directives. The landing page has no uml/plantweb directives at all (confirmed by grep). The two are completely independent: plantweb can be forced to PNG without affecting any hardcoded SVG references

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@spoorcc, you're absolutely right — I apologize for the false positive. The distinction is clear:

  • .plantwebrc only governs the output format for diagrams rendered from .. uml:: directives via plantweb.
  • .. raw:: html :file: static/patch-diagram.svg simply inlines a committed static asset at build time and is entirely unaffected by plantweb's configuration.

Since the landing page contains no .. uml:: directives, the two are fully independent. No fix is needed.

(^• ω •^) 🐰


✏️ Learnings added
Learnt from: spoorcc
Repo: dfetch-org/dfetch PR: 1100
File: .plantwebrc:1-1
Timestamp: 2026-04-01T16:18:39.670Z
Learning: In dfetch's Sphinx documentation, `.plantwebrc` (e.g., `{"format": "png"}`) only controls the output format of diagrams generated from `.. uml::` directives via plantweb. It has no effect on committed static SVG assets included via `.. raw:: html :file: path/to/file.svg`, which are simply inlined at build time. These two mechanisms are completely independent — changing `.plantwebrc` does not break hardcoded SVG references in `.rst` files.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sphinx:
configuration: doc/conf.py

formats:
- epub
- pdf
- htmlzip

build:
Expand Down
24 changes: 24 additions & 0 deletions dfetch.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,30 @@
"panel": "shared"
}
},
{
"label": "Build PDF Docs",
"type": "shell",
"linux": {
"command": "make"
},
"windows": {
"command": "make.bat"
},
"args": [
"latexpdf"
],
"options": {
"cwd": "${workspaceFolder}/doc"
},
"group": {
"kind": "build",
"isDefault": false
},
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Build Landing page",
"type": "shell",
Expand Down
4 changes: 3 additions & 1 deletion doc/_ext/sphinxcontrib_asciinema/asciinema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


def copy_asset_files(app, exc):
if app.builder.format != "html":
return
asset_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_static")
if exc is None: # build succeeded
for file in os.listdir(asset_dir):
Expand Down Expand Up @@ -83,7 +85,6 @@ def visit_html(self, node):


def visit_unsupported(self, node):
logger.warning("asciinema: unsupported output format (node skipped)")
raise nodes.SkipNode


Expand Down Expand Up @@ -177,6 +178,7 @@ def to_b64(self, filename):

_NODE_VISITORS = {
"html": (visit_html, depart),
"epub": (visit_unsupported, None),
"latex": (visit_unsupported, None),
"man": (visit_unsupported, None),
"texinfo": (visit_unsupported, None),
Expand Down
72 changes: 58 additions & 14 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# The short X.Y version.
version = __version__
# The full version, including alpha/beta/rc tags.
release = ""
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -187,26 +187,70 @@

# -- Options for LaTeX output ---------------------------------------------

latex_logo = "images/dfetch_logo.png"

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# Map Unicode check/cross marks used in alternatives.rst to pifont dingbats
# so pdflatex doesn't abort with "Unicode character not set up for use".
# Also configure fonts and colours to match the design system.
"preamble": r"""
\usepackage{newunicodechar}
\usepackage{pifont}
\newunicodechar{✔}{\ding{51}}
\newunicodechar{✘}{\ding{55}}
\usepackage{helvet}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\definecolor{dfprimary}{HTML}{c2620a}
\definecolor{dfaccent}{HTML}{4e7fa0}
\definecolor{dftextmuted}{HTML}{78716c}
\definecolor{dfnearblack}{HTML}{1c1917}
""",
# Design-token colours for Sphinx's built-in LaTeX style hooks
"sphinxsetup": (
"TitleColor={rgb}{0.761,0.384,0.039},"
"InnerLinkColor={rgb}{0.306,0.498,0.627},"
"OuterLinkColor={rgb}{0.306,0.498,0.627},"
"VerbatimColor={rgb}{0.996,0.973,0.941},"
"VerbatimBorderColor={rgb}{0.906,0.878,0.847},"
"noteBorderColor={rgb}{0.306,0.498,0.627},"
"warningBorderColor={rgb}{0.761,0.384,0.039},"
),
# Custom title page with amber header bar, logo, and accent footer.
# \makeatletter/\makeatother are required to access \py@release (@ is a
# letter in LaTeX package code but not in regular document mode).
# \sphinxlogo is NOT used here because it has no size constraint; instead
# we include the logo directly with an explicit width to keep the page count
# at exactly one regardless of the image's natural resolution.
"maketitle": r"""
\makeatletter
\begin{titlepage}
\noindent{\color{dfprimary}\rule{\linewidth}{6pt}}\par
\vspace*{\fill}
\begin{center}
\includegraphics[width=0.35\linewidth]{dfetch_logo.png}\par
\vspace{1.2cm}
{\fontsize{40}{44}\selectfont\bfseries\color{dfprimary}Dfetch\par}
\vspace{0.3cm}
{\LARGE\color{dfnearblack}Documentation\par}
\vspace{0.6cm}
{\large\color{dftextmuted}\textit{vendor dependencies without the pain}\par}
\vspace{1.5cm}
{\large\color{dftextmuted}\py@release\par}
\end{center}
\vspace*{\fill}
\noindent{\color{dfaccent}\rule{\linewidth}{4pt}}\par
\end{titlepage}
\makeatother
""",
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "dfetch.tex", "Dfetch Documentation", "Dfetch", "manual"),
(master_doc, f"dfetch-{__version__}.tex", "Dfetch Documentation", "Dfetch", "manual"),
]


Expand Down
11 changes: 8 additions & 3 deletions doc/howto/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ Running in Github Codespaces
Github codespaces make it possible to edit dfetch directly in the browser in a VSCode instance.
All dependencies are pre-installed and makes it easy to get started.

|CodespacesLink|_
.. raw:: html

<a href="https://codespaces.new/dfetch-org/dfetch">
<img src="https://github.com/codespaces/badge.svg" alt="Open in GitHub Codespaces" />
</a>

.. only:: not html

.. |CodespacesLink| image:: https://github.com/codespaces/badge.svg
.. _CodespacesLink: https://codespaces.new/dfetch-org/dfetch
`Open in GitHub Codespaces <https://codespaces.new/dfetch-org/dfetch>`_

.. tip::

Expand Down
Loading