Skip to content
Snippets Groups Projects
Commit 66a31862 authored by NLeSC Python template's avatar NLeSC Python template
Browse files

Cleanup automated next steps issue generator

parent 2ef866f2
No related branches found
No related tags found
No related merge requests found
---
title: 'Next step: Sonarcloud integration'
---
Continuous code quality can be handled by [Sonarcloud](https://sonarcloud.io/). This repository is configured to use Sonarcloud to perform quality analysis and code coverage report on each push.
In order to configure Sonarcloud analysis [GitHub Action workflow](https://github.com/ChristianDDinga/demoses-distributed-optimization/blob/main/.github/workflows/sonarcloud.yml) you must follow the steps below:
1. go to [Sonarcloud](https://sonarcloud.io/projects/create) to create a new Sonarcloud project
1. login with your GitHub account
1. add Sonarcloud organization or reuse existing one
1. set up a repository
1. go to [new code definition administration page](https://sonarcloud.io/project/new_code?id=ChristianDDinga_demoses-distributed-optimization) and select `Number of days` option
1. To be able to run the analysis:
1. a token must be created at [Sonarcloud account](https://sonarcloud.io/account/security/)
1. the created token must be added as `SONAR_TOKEN` to [secrets on GitHub](https://github.com/ChristianDDinga/demoses-distributed-optimization/settings/secrets/actions)
---
title: 'Next step: Citation data'
---
It is likely that your `CITATION.cff` currently doesn't pass validation. The error messages you get from the [`cffconvert`](https://github.com/ChristianDDinga/demoses-distributed-optimization/actions/workflows/cffconvert.yml) GitHub Action are unfortunately a bit cryptic, but doing the following helps:
- [ ] Check if the `given-name` and `family-name` keys need updating. If your family name has a name particle like `von` or `van` or `de`, use the `name-particle` key; if your name has a suffix like `Sr` or `IV`, use `name-suffix`. For details, refer to the schema description: https://github.com/citation-file-format/citation-file-format
- [ ] Update the value of the `orcid` key. If you do not have an orcid yet, you can get one here [https://orcid.org/](https://orcid.org/).
- [ ] Add more authors if needed
- [ ] Update `date-released` using the YYYY-MM-DD format.
- [ ] Update the `doi` key with the conceptDOI for your repository (see [https://help.zenodo.org](https://help.zenodo.org/) for more information on what a conceptDOI is). If your project doesn't have a DOI yet, you can use the string `10.0000/FIXME` to pass validation.
- [ ] Verify that the `keywords` array accurately describes your project.
Afterwards, the `cffconvert` GitHub Action should be green.
To make sure services like [Zenodo](https://zenodo.org) and the [Research Software Directory](https://research-software-directory.org/) can keep your citation data up to date, the [`cffconvert`](https://github.com/ChristianDDinga/demoses-distributed-optimization/actions/workflows/cffconvert.yml) GitHub Action checks the following:
1. Whether your repository includes a `CITATION.cff` file.
_By including this file, authors of the software can receive credit for the work they put in._
1. Whether your `CITATION.cff` is valid YAML.
_Visit http://www.yamllint.com/ to see if the contents of your CITATION.cff are valid YAML._
1. Whether your `CITATION.cff` adheres to the schema (as listed in the `CITATION.cff` file itself under key `cff-version`).
_The Citation File Format schema can be found [here](https://github.com/citation-file-format/citation-file-format), along with an explanation of all the keys. You're advised to use the latest available schema version._
---
title: 'Next step: Read the Docs'
---
Your Python package should have publicly available documentation, including API documentation for your users.
[Read the Docs](https://readthedocs.org) can host your user documentation for you.
To host the documentation of this repository please perform the following instructions:
1. go to [Read the Docs](https://readthedocs.org/dashboard/import/?)
1. log in with your GitHub account
1. find `ChristianDDinga/demoses-distributed-optimization` in list and press `+` button.
* If repository is not listed,
1. go to [Read the Docs GitHub app](https://github.com/settings/connections/applications/fae83c942bc1d89609e2)
2. make sure ChristianDDinga has been granted access.
3. reload repository list on Read the Docs import page
1. wait for the first build to be completed at <https://readthedocs.org/projects/demoses-distributed-optimization/builds>
1. check that the link of the documentation badge in the [README.md](https://github.com/ChristianDDinga/demoses-distributed-optimization) works
See [README.dev.md#](https://github.com/ChristianDDinga/demoses-distributed-optimization/blob/main/README.dev.md#generating-the-api-docs) how to build documentation site locally.
---
title: 'Next step: Enable Zenodo integration'
---
By enabling Zenodo integration, your package will automatically get a DOI which can be used to cite your package. After enabling Zenodo integration for your GitHub repository, Zenodo will create a snapshot and archive each release you make on GitHub. Moreover, Zenodo will create a new DOI for each GitHub release of your code.
To enable Zenodo integration:
1. Go to http://zenodo.org and login with your GitHub account. When you are redirected to GitHub, *Authorize application* to give permission to Zenodo to access your account.
1. Go to <https://zenodo.org/account/settings/github/> and enable Zenodo integration of your repository by clicking on `On` toggle button.
2. Your package will get a DOI only after you make a release. Create a new release as described in [README.dev.md](https://github.com/ChristianDDinga/demoses-distributed-optimization/blob/main/README.dev.md#33-github)
3. At this point you should have a DOI. To find out the DOI generated by Zenodo:
1. Visit https://zenodo.org/deposit and click on your repository link
2. You will find the latest DOI in the right column in Versions box in **Cite all versions?** section
3. Copy the text of the link. For example `10.5281/zenodo.1310751`
4. Update the badge in your repository
1. Edit README.md and replace the badge placeholder with the badge link you copied in previous step.
The badge placeholder is shown below.
`[![DOI](https://zenodo.org/badge/DOI/<replace-with-created-DOI>.svg)](https://doi.org/<replace-with-created-DOI>)`
For FAQ about Zenodo please visit <https://help.zenodo.org/>.
---
title: 'Next step: Linting'
---
Your repository has a [workflow](https://github.com/ChristianDDinga/demoses-distributed-optimization/blob/main/.github/workflows/build.yml) which [lints](https://en.wikipedia.org/wiki/Lint_(software)) your code after every push and when creating a pull request.
Linter workflow may fail if `description` or `keywords` field in [pyproject.toml](https://github.com/ChristianDDinga/demoses-distributed-optimization/blob/main/pyproject.toml) is empty. Please update these fields. To validate your changes run:
```shell
ruff .
```
Enabling [githook](https://git-scm.com/docs/githooks) will automatically lint your code in every commit. You can enable it by running the command below.
```shell
git config --local core.hooksPath .githooks
```
on: [push]
permissions:
contents: write
issues: write
name: Create issues for next steps
jobs:
next_steps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Sonarcloud integration issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/01_sonarcloud_integration.md
id: sonarcloud
- name: Create citation data issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/02_citation.md
id: citation
- name: Create readthedocs issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/03_readthedocs.md
id: readthedocs
- name: Create Zenodo integration issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/04_zenodo_integration.md
id: zenodo
- name: Create linting issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/05_linting.md
id: linting
- name: List created issues
run: |
echo 'Created issues that must be completed to have fully working Python package:
* Sonarcloud integration ${{ steps.sonarcloud.outputs.url }}
* Zenodo integration ${{ steps.zenodo.outputs.url }}
* Read the Docs instructions ${{ steps.readthedocs.outputs.url }}
* Citation data ${{ steps.citation.outputs.url }}
* Linting fixes ${{ steps.linting.outputs.url }}'
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
git rm .github/workflows/next_steps.yml
git rm -r .github/next_steps
git commit -am "Cleanup automated next steps issue generator"
git push
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment