Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ci_validate_hub_config() function #37

Merged
merged 18 commits into from
Aug 27, 2024
Merged

add ci_validate_hub_config() function #37

merged 18 commits into from
Aug 27, 2024

Conversation

zkamvar
Copy link
Member

@zkamvar zkamvar commented Aug 19, 2024

This adds the exported function ci_validate_hub_config(). It will replace 24 lines of R code embedded in YAML with a single call: hubAdmin::ci_validate_hub_config().

It will not show up in the default user manual because I've added the internal keyword to its documentation.

This will fix #31

The new steps for the validate-config action would look like this:

     - uses: actions/checkout@v4
     - uses: r-lib/actions/setup-r@v2
       with:
         install-r: false
         use-public-rspm: true
         extra-repositories: 'https://hubverse-org.r-universe.dev'
     - uses: r-lib/actions/setup-r-dependencies@v2
       with:
         cache: 'always'
         packages: |
           any::hubAdmin
           any::sessioninfo
     - name: Run validations
       id: validate
       run: hubAdmin::ci_validate_config()
       shell: Rscript {0}
     - name: "Comment on PR"
       id: comment-diff
       if: ${{ github.event_name != 'workflow_dispatch' }}
       uses: carpentries/actions/comment-diff@main
       with:
         pr: ${{ env.PR_NUMBER }}
         path: ${{ env.HUB_PATH }}/diff.md
     - name: Error on Failure
       if: ${{ steps.validate.outputs.result == 'false' }}
       run: |
         echo "::error title=Invalid Configuration::Errors were detected in one or more config files in 'hub-config/'"
         exit 1

Copy link

github-actions bot commented Aug 19, 2024

@zkamvar zkamvar requested a review from annakrystalli August 23, 2024 19:29
@zkamvar zkamvar marked this pull request as ready for review August 23, 2024 19:29
@zkamvar zkamvar changed the title Znk/add ci function 31 add ci_validate_hub_config() function 31 Aug 23, 2024
Copy link
Member

@annakrystalli annakrystalli left a comment

Choose a reason for hiding this comment

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

Overall looks great! Thanks for this nice addition!

Made some comments and requests for changes. Happy to discuss any points.

NEWS.md Outdated Show resolved Hide resolved
NEWS.md Show resolved Hide resolved
DESCRIPTION Show resolved Hide resolved
R/ci_validate_hub_config.R Outdated Show resolved Hide resolved
R/ci_validate_hub_config.R Show resolved Hide resolved
R/ci_validate_hub_config.R Outdated Show resolved Hide resolved
tests/testthat/test-ci_validate_hub_config.R Outdated Show resolved Hide resolved
tests/testthat/test-ci_validate_hub_config.R Outdated Show resolved Hide resolved
@zkamvar zkamvar changed the title add ci_validate_hub_config() function 31 add ci_validate_hub_config() function Aug 27, 2024
@zkamvar zkamvar requested a review from annakrystalli August 27, 2024 15:00
@zkamvar
Copy link
Member Author

zkamvar commented Aug 27, 2024

Ready for your review, @annakrystalli, but I have no clue why the lintr is getting angry with me.... it's valid tidyverse style and I can't reproduce the error on my machine.

Copy link
Member

@annakrystalli annakrystalli left a comment

Choose a reason for hiding this comment

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

Looks great and good to see you won your battle with cLINT EsatWooOD 😆

@zkamvar zkamvar merged commit e26134a into main Aug 27, 2024
8 checks passed
@zkamvar zkamvar deleted the znk/add-ci-function-31 branch August 27, 2024 17:10
@zkamvar zkamvar mentioned this pull request Aug 29, 2024
2 tasks
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.

Add function to produce a report from validate_hub_config() and view_config_val_errors() on CI
2 participants