Skip to content

Conversation

@ahmadtourei
Copy link
Collaborator

@ahmadtourei ahmadtourei commented Jun 24, 2025

Description

This PR adds GitHub workflows to build docs in PRs with the "documentation" label.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes.
  • documented the new feature with docstrings or appropriate doc page.
  • included a test. See testing guidelines.
  • your name has been added to the contributors page (docs/contributors.md).
  • added the "ready_for_review" tag once the PR is ready to be reviewed.

Summary by CodeRabbit

  • Documentation
    • Corrected capitalization in the bug report template.
    • Fixed a typographical error in an example within the dispersion phase shift documentation.
    • Improved formatting in the tau_p function documentation.
  • Chores
    • Added a GitHub labeler configuration to automatically label documentation-related pull requests.
    • Introduced a GitHub Actions workflow to label pull requests based on file changes.
    • Added a workflow job to build and publish documentation when pull requests are labeled as documentation.
    • Added a new workflow to automate testing and artifact upload of documentation builds on labeled pull requests.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 24, 2025

Walkthrough

This update introduces a GitHub Actions labeler workflow and configuration to automatically label pull requests that modify documentation files. It also adds a conditional documentation build-and-publish job to the test workflow, triggered by the "documentation" label. Minor corrections to docstrings and issue template capitalization are included.

Changes

File(s) Change Summary
.github/ISSUE_TEMPLATE/bug_report.md Corrected capitalization from "DasCore Version" to "DASCore Version" in the bug report template.
.github/labeler.yml, .github/workflows/labeler.yml Added labeler config and workflow to auto-label PRs modifying docs or Markdown files with "documentation".
.github/workflows/runtests.yml Added build-docs job to build and publish documentation on PRs labeled "documentation".
.github/workflows/test_doc_build.yml Added new workflow to test documentation builds on PRs labeled "documentation".
dascore/transform/dispersion.py Fixed a variable name typo in the dispersion_phase_shift docstring example.
dascore/transform/taup.py Minor formatting and spacing corrections in the tau_p docstring example.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub
    participant PR
    participant Labeler Action
    participant Test Workflow

    GitHub->>PR: PR opened or updated
    PR->>Labeler Action: Trigger labeler workflow
    Labeler Action->>PR: Apply "documentation" label if docs/** or *.md changed
    PR->>Test Workflow: Trigger test workflow
    alt PR labeled "documentation"
        Test Workflow->>build-docs job: Build and publish documentation
    else PR not labeled "documentation"
        Test Workflow->>test job: Run standard tests only
    end
Loading

Suggested reviewers

  • d-chambers

Poem

In the warren, docs now shine bright,
With labelers hopping left and right.
A typo fixed, a header raised,
Auto-magic builds—rabbits amazed!
Markdown and docs, we celebrate anew,
🐇✨ Code and carrots, for me and you!


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
.github/workflows/labeler.yml (1)

13-16: Be explicit about the config path to avoid future ambiguity

Consider passing configuration-path: ".github/labeler.yml" to the action.
If the default lookup ever changes (or the file is relocated) the job will still work.

       - uses: actions/labeler@v5
         with:
           repo-token: "${{ secrets.GITHUB_TOKEN }}"
+          configuration-path: ".github/labeler.yml"
.github/ISSUE_TEMPLATE/bug_report.md (1)

24-28: Fix list-item indentation flagged by markdownlint

MD007 warns because the bullet at line 26 is indented one space deeper than the others.

  - OS [e.g. Ubuntu 20.04]:
- - DASCore Version [e.g. 0.0.5]:
+ - DASCore Version [e.g. 0.0.5]:
  - Python Version [e.g. 3.10]:
.github/workflows/runtests.yml (2)

69-70: Clean up trailing whitespace

yamllint is already flagging these two blank-lines because they contain stray spaces. While GitHub Actions’ runner will happily ignore them, they keep the file from passing basic linting in many editors/CI linters.

-  # Tests building the docs if the PR is labeled as documentation        
+  # Tests building the docs if the PR is labeled as documentation

(…and delete the spaces on the previous blank line as well.)


75-76: Indentation triggers a yamllint error

yamllint reports expected 4 but found 6 for the first list item under steps:.
YAML tolerates either style, but mixing the two (4-space vs 2-space indent for list items) in the same file tends to bite later when someone inserts anchors or overrides.

Pick one style and keep it consistent, e.g.

-    steps:
-      - uses: actions/checkout@v4
+    steps:
+    - uses: actions/checkout@v4
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79c5fd8 and 927301b.

📒 Files selected for processing (6)
  • .github/ISSUE_TEMPLATE/bug_report.md (1 hunks)
  • .github/labeler.yml (1 hunks)
  • .github/workflows/labeler.yml (1 hunks)
  • .github/workflows/runtests.yml (1 hunks)
  • dascore/transform/dispersion.py (1 hunks)
  • dascore/transform/taup.py (2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
.github/ISSUE_TEMPLATE/bug_report.md

26-26: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

🪛 GitHub Actions: TestCodeMinDeps
.github/labeler.yml

[error] 1-1: Git error: invalid path '.github/labeler.yml '

🪛 GitHub Actions: TestCode
.github/labeler.yml

[error] 1-1: Git error: invalid path detected for the file '.github/labeler.yml '

🪛 GitHub Actions: LintCode
.github/labeler.yml

[error] 1-1: Pre-commit hook 'end-of-file-fixer' failed and modified this file to fix end-of-file issues.

🪛 GitHub Actions: Label PRs
.github/labeler.yml

[warning] 1-1: The config file was not found at .github/labeler.yml. Make sure it exists and that this action has the correct access rights.

🪛 YAMLlint (1.37.1)
.github/workflows/runtests.yml

[error] 69-69: trailing spaces

(trailing-spaces)


[error] 70-70: trailing spaces

(trailing-spaces)


[warning] 76-76: wrong indentation: expected 4 but found 6

(indentation)


[error] 94-94: trailing spaces

(trailing-spaces)

🔇 Additional comments (3)
dascore/transform/taup.py (1)

101-103: Docstring header fix looks good

Changing “Examples / --------” to “Example / -------” aligns the underline length with the header. No action needed.

dascore/transform/dispersion.py (1)

85-87: Typo in example variable name corrected

mirrored_patch replaces the garbled identifier – makes the example runnable. Nice catch.

.github/workflows/runtests.yml (1)

80-84: Verify that mamba-install-dascore supports the environment-file input

The previous job only passes python-version; here we add

with:
  python-version: "3.12"
  environment-file: './.github/doc_environment.yml'

If the custom composite action wasn’t updated to accept environment-file, the job will silently ignore the argument and use the default environment.yml, causing divergent doc builds or outright failures.

Please confirm (or update the action).

Comment on lines 1 to 3
documentation:
- 'docs/**'
- '**/*.md' No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the filename – current path contains a trailing space and breaks all CI jobs

CI reports Git error: invalid path '.github/labeler.yml ' and the labeler action cannot find the config.
You accidentally committed the file with a trailing space in its path, so it’s written as
.github/labeler.yml␠ rather than .github/labeler.yml.

  1. Rename the file to remove the trailing space (git mv ".github/labeler.yml " .github/labeler.yml).
  2. Commit with a proper newline at EOF to satisfy end-of-file-fixer.
 documentation:
   - 'docs/**'
   - '**/*.md'
+

Without this fix, every workflow that tries to read the config will fail.

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 GitHub Actions: TestCodeMinDeps

[error] 1-1: Git error: invalid path '.github/labeler.yml '

🪛 GitHub Actions: TestCode

[error] 1-1: Git error: invalid path detected for the file '.github/labeler.yml '

🪛 GitHub Actions: LintCode

[error] 1-1: Pre-commit hook 'end-of-file-fixer' failed and modified this file to fix end-of-file issues.

🪛 GitHub Actions: Label PRs

[warning] 1-1: The config file was not found at .github/labeler.yml. Make sure it exists and that this action has the correct access rights.

🤖 Prompt for AI Agents
In the file .github/labeler.yml at lines 1 to 3, the filename has a trailing
space causing CI failures. Rename the file to remove the trailing space using
git mv to correct the path to .github/labeler.yml. Then commit the change
ensuring the file ends with a proper newline to satisfy the end-of-file-fixer.

⚠️ Potential issue

Filename contains trailing whitespace → CI cannot locate the config file

All CI jobs are failing with “invalid path '.github/labeler.yml 'and “config file not found” because the committed filename (and possibly the path in the Git index) ends with one or more space characters. Git treats that as a different pathname, while the workflows andactions/labelerlook for the exact literal.github/labeler.yml`.

Action items

  1. Rename the file in the repo to remove the trailing spaces:
    git mv ".github/labeler.yml " ".github/labeler.yml"
  2. Commit with a proper newline at EOF to satisfy the end-of-file-fixer hook.

Without fixing the path, the labeler workflow will never load this config and documentation PRs will not be auto-labeled.

🧰 Tools
🪛 GitHub Actions: TestCodeMinDeps

[error] 1-1: Git error: invalid path '.github/labeler.yml '

🪛 GitHub Actions: TestCode

[error] 1-1: Git error: invalid path detected for the file '.github/labeler.yml '

🪛 GitHub Actions: LintCode

[error] 1-1: Pre-commit hook 'end-of-file-fixer' failed and modified this file to fix end-of-file issues.

🪛 GitHub Actions: Label PRs

[warning] 1-1: The config file was not found at .github/labeler.yml. Make sure it exists and that this action has the correct access rights.

🤖 Prompt for AI Agents
In the file .github/labeler.yml at lines 1 to 3, the filename contains trailing
whitespace causing CI to fail to locate the config file. Rename the file to
remove the trailing spaces by using git mv to rename ".github/labeler.yml " to
".github/labeler.yml". Then commit the change ensuring there is a proper newline
at the end of the file to satisfy the end-of-file-fixer hook.

Comment on lines 87 to 94
- name: publish docs to netlify
shell: bash -l {0}
env:
QUARTO_PRINT_STACK: true
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
quarto publish docs --no-prompt --no-browser
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Ensure Quarto is available before publishing

The final step assumes quarto is on the PATH, but the preceding build-docs action does not guarantee that. If Quarto is installed inside that composite action’s environment, great; otherwise this step will 404.

Consider making the dependency explicit, e.g.

-      - name: publish docs to netlify
+      - name: publish docs to Netlify
         shell: bash -l {0}
         env:
           QUARTO_PRINT_STACK: true
           NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
         run: |
-            quarto publish docs --no-prompt --no-browser
+            which quarto || { echo "Quarto not found"; exit 1; }
+            quarto publish docs --no-prompt --no-browser
📝 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: publish docs to netlify
shell: bash -l {0}
env:
QUARTO_PRINT_STACK: true
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
quarto publish docs --no-prompt --no-browser
- name: publish docs to Netlify
shell: bash -l {0}
env:
QUARTO_PRINT_STACK: true
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
which quarto || { echo "Quarto not found"; exit 1; }
quarto publish docs --no-prompt --no-browser
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 94-94: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In .github/workflows/runtests.yml around lines 87 to 94, the publish docs step
assumes Quarto is available on the PATH, but this is not guaranteed by the
previous build-docs action. To fix this, explicitly install or ensure Quarto is
accessible before running the publish command, such as adding a step to install
Quarto or sourcing its environment so the quarto command is found.

@codecov
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.85%. Comparing base (79c5fd8) to head (97c0f8e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #504   +/-   ##
=======================================
  Coverage   99.85%   99.85%           
=======================================
  Files         118      118           
  Lines        9711     9711           
=======================================
  Hits         9697     9697           
  Misses         14       14           
Flag Coverage Δ
unittests 99.85% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

@ahmadtourei ahmadtourei added the documentation Improvements or additions to documentation label Jun 24, 2025
@ahmadtourei
Copy link
Collaborator Author

Although I added "documentation" label to this PR (and then also re-ran the workflow tests), the TestCode/build-docs is still skipped. Maybe this will be fixed in the next PRs?

pull-requests: write

steps:
- uses: actions/checkout@v4 # pulls the PR code
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the checkout action needed for automatic labeling? The example on the docs page doesn't use it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I don't think it's needed.

Comment on lines 87 to 94
- name: publish docs to netlify
shell: bash -l {0}
env:
QUARTO_PRINT_STACK: true
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
quarto publish docs --no-prompt --no-browser
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably don't want to publish the docs until they actually merge into master. Otherwise, we might burn through our free hosting on netlify, and it could be confusing for users looking for the development docs if they are constantly changing as someone works on a PR.

Consider just uploading the built docs as an artifact using the upload action, then the users can look at them. I think its the docs/_site directory you would want to upload.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Just removed it.

@d-chambers
Copy link
Contributor

d-chambers commented Jun 25, 2025

Although I added "documentation" label to this PR (and then also re-ran the workflow tests), the TestCode/build-docs is still skipped. Maybe this will be fixed in the next PRs?

It appears something may be broken with the action triggering the PR based on the tag. I think the comments on this SO post might be helpful.

Actually, thinking more about it, I am inclined to put this in it's own action. TestCode runs on both PRs and when code is merged into master. In the latter case, the docs would be built twice, which is a waste of CI resources.

So, I suggest making a new workflow called test_doc_build.yml. Maybe something like this?

name: TestDocBuild

on:
  pull_request:
    types: [labeled, synchronize]

jobs:
  test_build_docs:
    if: |
      (github.event.action == 'labeled' && github.event.label.name == 'documentation')
      || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation'))
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-tags: 'true'

      - uses: ./.github/actions/mamba-install-dascore
        with:
          python-version: "3.12"
          environment-file: './.github/doc_environment.yml'

      - uses: ./.github/actions/build-docs

      - uses: actions/upload-artifact@v4
        with:
          name: documentation_build_test
          path: ./docs/_site
          retention-days: 1 

If this is right, it will run under two conditions: 1) when a new commit is pushed to the PR AND the PR has the documentation label. 2) When the documentation label is added to the PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
.github/workflows/runtests.yml (2)

69-76: Fix YAML-lint issues (trailing spaces & wrong indent)

Minor but noisy: several lines carry stray spaces and steps: is indented with 6 instead of 4 spaces, tripping yamllint.

-  build-docs:
-    if: contains(github.event.pull_request.labels.*.name, 'documentation')
-    runs-on: ubuntu-latest  
+  build-docs:
+    if: contains(github.event.pull_request.labels.*.name, 'documentation')
+    runs-on: ubuntu-latest
   steps:
-      - uses: actions/checkout@v4
+    - uses: actions/checkout@v4

…and delete the trailing blanks on 69, 70, 86, 87.


72-73: Guard expression against non-PR events

When this workflow runs on a push to master, github.event.pull_request doesn’t exist. The current expression usually resolves to false, but GitHub has thrown “Property not found” errors in the past.

-if: contains(github.event.pull_request.labels.*.name, 'documentation')
+if: github.event_name == 'pull_request' &&
+    contains(github.event.pull_request.labels.*.name, 'documentation')

Makes intent explicit and future-proof.

.github/workflows/test_doc_build.yml (1)

25-29: Strip trailing whitespace to appease linters

Line 29 ends with two spaces; yamllint flags it.

-          retention-days: 1␠␠
+          retention-days: 1
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da0f4ad and 5a2957d.

📒 Files selected for processing (4)
  • .github/labeler.yml (1 hunks)
  • .github/workflows/labeler.yml (1 hunks)
  • .github/workflows/runtests.yml (1 hunks)
  • .github/workflows/test_doc_build.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/labeler.yml
  • .github/workflows/labeler.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/runtests.yml

[error] 69-69: trailing spaces

(trailing-spaces)


[error] 70-70: trailing spaces

(trailing-spaces)


[warning] 76-76: wrong indentation: expected 4 but found 6

(indentation)


[error] 86-86: trailing spaces

(trailing-spaces)


[error] 87-87: trailing spaces

(trailing-spaces)

.github/workflows/test_doc_build.yml

[error] 29-29: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: test_code_min_deps (windows-latest, 3.13)
  • GitHub Check: test_code_min_deps (windows-latest, 3.12)
  • GitHub Check: test_code_min_deps (macos-latest, 3.13)
  • GitHub Check: test_code_min_deps (ubuntu-latest, 3.12)
  • GitHub Check: test_code_min_deps (ubuntu-latest, 3.13)
  • GitHub Check: test_code (windows-latest, 3.12)
  • GitHub Check: test_code (windows-latest, 3.11)
  • GitHub Check: test_code (windows-latest, 3.10)
  • GitHub Check: build-docs
  • GitHub Check: test_build_docs
🔇 Additional comments (1)
.github/workflows/test_doc_build.yml (1)

1-30: Redundancy with build-docs job in runtests.yml

This standalone workflow is cleaner, but while build-docs still lives in runtests.yml both will fire, wasting CI minutes. After removing the duplicated job there, this file alone covers the use-case.

Comment on lines +69 to +87

# Tests building the docs if the PR is labeled as documentation
build-docs:
if: contains(github.event.pull_request.labels.*.name, 'documentation')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-tags: 'true'

- uses: ./.github/actions/mamba-install-dascore
with:
python-version: "3.12"
environment-file: './.github/doc_environment.yml'

- uses: ./.github/actions/build-docs


Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid duplicated documentation build logic – keep it in one workflow only

build-docs here performs the exact same work that the brand-new TestDocBuild workflow does. Duplicating the job means:

  • two identical doc builds are queued for every labelled PR,
  • twice the runner minutes & cache pressure,
  • twice the artefacts to sift through.

Unless you still need the matrix from runtests.yml, drop this job and let the dedicated workflow own the doc-build responsibility.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 69-69: trailing spaces

(trailing-spaces)


[error] 70-70: trailing spaces

(trailing-spaces)


[warning] 76-76: wrong indentation: expected 4 but found 6

(indentation)


[error] 86-86: trailing spaces

(trailing-spaces)


[error] 87-87: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In .github/workflows/runtests.yml between lines 69 and 87, the build-docs job
duplicates the documentation build logic already handled by the TestDocBuild
workflow. To fix this, remove the entire build-docs job from runtests.yml so
that only the dedicated TestDocBuild workflow manages documentation builds,
avoiding redundant runs and resource usage.

@ahmadtourei
Copy link
Collaborator Author

Although I added "documentation" label to this PR (and then also re-ran the workflow tests), the TestCode/build-docs is still skipped. Maybe this will be fixed in the next PRs?

It appears something may be broken with the action triggering the PR based on the tag. I think the comments on this SO post might be helpful.

Actually, thinking more about it, I am inclined to put this in it's own action. TestCode runs on both PRs and when code is merged into master. In the latter case, the docs would be built twice, which is a waste of CI resources.

So, I suggest making a new workflow called test_doc_build.yml. Maybe something like this?

name: TestDocBuild

on:
  pull_request:
    types: [labeled, synchronize]

jobs:
  test_build_docs:
    if: |
      (github.event.action == 'labeled' && github.event.label.name == 'documentation')
      || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation'))
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-tags: 'true'

      - uses: ./.github/actions/mamba-install-dascore
        with:
          python-version: "3.12"
          environment-file: './.github/doc_environment.yml'

      - uses: ./.github/actions/build-docs

      - uses: actions/upload-artifact@v4
        with:
          name: documentation_build_test
          path: ./docs/_site
          retention-days: 1 

If this is right, it will run under two conditions: 1) when a new commit is pushed to the PR AND the PR has the documentation label. 2) When the documentation label is added to the PR.

Yes, it makes more sense to have this under a new workflow test. Just added it. However, shouldn't we have contains(github.event.pull_request.labels.*.name, 'documentation') in the first if statement?

      (github.event.action == 'labeled' && contains(github.event.pull_request.labels.*.name, 'documentation'))
      || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation'))

@ahmadtourei ahmadtourei added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Jun 27, 2025
@ahmadtourei
Copy link
Collaborator Author

I see TestDocBuild / test_build_docs is built when the PR has the "documentation" label and also when the label is added later to the PR.

@d-chambers
Copy link
Contributor

Yes, it makes more sense to have this under a new workflow test. Just added it. However, shouldn't we have contains(github.event.pull_request.labels.*.name, 'documentation') in the first if statement?

Ya, I guess this makes sense.

@d-chambers d-chambers added the CI continuous integration label Jun 27, 2025
@d-chambers
Copy link
Contributor

Actually no, I just added the CI tag and it triggered the doc build.

We want it to only trigger it if the documentation tag is added OR the documentation tag already exists and a new commit is pushed to the PR.

@ahmadtourei
Copy link
Collaborator Author

github.event.label.name == 'documentation'

Gotcha, thanks for clarifying. Fun little CI project :)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/test_doc_build.yml (2)

29-29: Trailing whitespace breaks YAML-lint and can fail strict CI checks

Line 29 ends with one extra space. Remove it to keep the workflow YAML-lint-clean.

-          retention-days: 1␠
+          retention-days: 1

10-11: Minor readability: use folded scalar instead of literal block for multi-line if

If you prefer keeping the expression multi-line, switch |> so the newline is folded into a single space, avoiding an embedded \n inside the expression string:

-    if: |
+    if: >-

Not required once the single-line ${{ … }} variant above is adopted.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a2957d and 97c0f8e.

📒 Files selected for processing (1)
  • .github/workflows/test_doc_build.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/test_doc_build.yml

[error] 29-29: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: test_code_min_deps (windows-latest, 3.12)
  • GitHub Check: test_code_min_deps (macos-latest, 3.13)
  • GitHub Check: test_code_min_deps (ubuntu-latest, 3.12)
  • GitHub Check: test_code_min_deps (macos-latest, 3.12)
  • GitHub Check: test_code_min_deps (windows-latest, 3.13)
  • GitHub Check: test_code_min_deps (ubuntu-latest, 3.13)
  • GitHub Check: test_code (windows-latest, 3.10)
  • GitHub Check: test_code (macos-latest, 3.12)
  • GitHub Check: test_code (ubuntu-latest, 3.12)
  • GitHub Check: test_code (windows-latest, 3.12)
  • GitHub Check: test_build_docs
  • GitHub Check: test_code (windows-latest, 3.11)
  • GitHub Check: test_code (ubuntu-latest, 3.10)
  • GitHub Check: test_code (ubuntu-latest, 3.11)
  • GitHub Check: test_code (macos-latest, 3.11)
  • GitHub Check: test_code (macos-latest, 3.10)
  • GitHub Check: build-docs

Comment on lines +9 to +12
if: |
(github.event.action == 'labeled' && github.event.label.name == 'documentation')
|| (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation'))
runs-on: ubuntu-latest
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

✅ Verification successful

Expression should be wrapped in ${{ … }} to guarantee evaluation & avoid silent‐string fallback

GitHub treats the if value as a literal string unless it begins with ${{.
While an unwrapped expression usually still works, you lose linter/IDE validation and can hit subtle quoting bugs (e.g. an accidental literal "false" will not be parsed). Wrapping also lets the runner short-circuit early instead of scheduling the job and then discarding it.

-    if: |
-      (github.event.action == 'labeled' && github.event.label.name == 'documentation')
-      || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation'))
+    if: ${{ github.event.action == 'labeled' && github.event.label.name == 'documentation'
+          || github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation') }}

Expression should be wrapped in ${{ … }} to guarantee evaluation & avoid silent‐string fallback

GitHub treats the if value as a literal string unless it begins with ${{.
While an unwrapped expression usually still works, you lose linter/IDE validation and can hit subtle quoting bugs (e.g. an accidental literal "false" will not be parsed). Wrapping also lets the runner short-circuit early instead of scheduling the job and then discarding it.

-    if: |
-      (github.event.action == 'labeled' && github.event.label.name == 'documentation')
-      || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation'))
+    if: ${{ github.event.action == 'labeled' && github.event.label.name == 'documentation'
+          || github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation') }}
📝 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
if: |
(github.event.action == 'labeled' && github.event.label.name == 'documentation')
|| (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation'))
runs-on: ubuntu-latest
if: ${{ github.event.action == 'labeled' && github.event.label.name == 'documentation'
|| github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation') }}
runs-on: ubuntu-latest
🤖 Prompt for AI Agents
In .github/workflows/test_doc_build.yml around lines 9 to 12, the if condition
expression is not wrapped in ${{ ... }}, causing GitHub Actions to treat it as a
literal string. To fix this, wrap the entire multiline if expression inside ${{
and }} to ensure proper evaluation, enable linter/IDE validation, and prevent
subtle bugs.

@ahmadtourei ahmadtourei added bug Something isn't working documentation Improvements or additions to documentation and removed bug Something isn't working documentation Improvements or additions to documentation labels Jun 27, 2025
@ahmadtourei
Copy link
Collaborator Author

The CI's behavior is as expected. Just tested it by adding document and non-document labels.

Copy link
Contributor

@d-chambers d-chambers left a comment

Choose a reason for hiding this comment

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

Nice, great work.

@ahmadtourei ahmadtourei merged commit fc1bd6e into master Jun 27, 2025
23 checks passed
@ahmadtourei ahmadtourei deleted the ci_test_docs branch June 27, 2025 15:40
@ahmadtourei ahmadtourei mentioned this pull request Aug 6, 2025
5 tasks
@coderabbitai coderabbitai bot mentioned this pull request Sep 26, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI continuous integration documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants