|
| 1 | +# Contributor Guide |
| 2 | + |
| 3 | +## Git |
| 4 | + |
| 5 | +We use the `dev` branch for development. All feature branches should be based |
| 6 | +off `dev`. |
| 7 | + |
| 8 | +The `master` branch corresponds to the latest release. We deploy to [Julia |
| 9 | +General Registry][jgr] and `git tag -a` off `master`. |
| 10 | + |
| 11 | +## Running the unit tests (aka Julia tests) |
| 12 | + |
| 13 | +```sh |
| 14 | +git clone [email protected]:plotly/Dash.jl.git |
| 15 | +cd Dash.jl |
| 16 | +julia |
| 17 | +``` |
| 18 | + |
| 19 | +```jl |
| 20 | +julia> import Pkg |
| 21 | +julia> Pkg.activate(".") |
| 22 | +julia> Pkg.instantiate() |
| 23 | +julia> Pkg.update() |
| 24 | +julia> Pkg.test() |
| 25 | +``` |
| 26 | + |
| 27 | +To run the unit tests for multiple versions of Julia, we recommend using [`juliaup`][juliaup]. |
| 28 | + |
| 29 | +## Running the integration tests |
| 30 | + |
| 31 | +The integration tests make use of the [`dash.testing`][testing] module part of |
| 32 | +the Python version of dash. |
| 33 | + |
| 34 | +Instructions on how to install the required system dependencies can be found |
| 35 | +in the [dash Contributor Guide][dash-cg]. |
| 36 | + |
| 37 | +Then, |
| 38 | + |
| 39 | +```sh |
| 40 | +cd Dash.jl |
| 41 | +git clone --depth 1 https://github.com/plotly/dash.git -b dev dash-main |
| 42 | +python3 -m venv venv |
| 43 | +pip install --upgrade pip wheel |
| 44 | +cd dash-main && pip install -e .[ci,dev,testing] && cd ..dash |
| 45 | +pytest --headless --nopercyfinalize --percy-assets=test/assets/ test/integration/ |
| 46 | +``` |
| 47 | + |
| 48 | +Alternatively, one can run the integration tests using the same Docker |
| 49 | +image as for our CircleCI test runs. See the [Docker image guide][docker-test] |
| 50 | +for the details. |
| 51 | + |
| 52 | +## Updating the resources |
| 53 | + |
| 54 | +See the [Generate Dash.jl artifacts][resources]. |
| 55 | + |
| 56 | +## Updating the CircleCI Docker image |
| 57 | + |
| 58 | +See the [Docker image guide][docker-update]. |
| 59 | + |
| 60 | +## Code Style |
| 61 | + |
| 62 | +- indent with 4 spaces (no tabs), |
| 63 | +- no whitespaces at EOLs, |
| 64 | +- add a single newline at EOFs. |
| 65 | + |
| 66 | +See the [`lint.yml` workflow][lint] for the details. |
| 67 | + |
| 68 | +## Making a release |
| 69 | + |
| 70 | +**Please follow the steps in order!** For example, running `git tag -a` before |
| 71 | +`@JuliaRegistrator register` will lead to a failed release! |
| 72 | + |
| 73 | +In the following steps, note that "X.Y.Z" refers to the new version we are |
| 74 | +releasing. |
| 75 | + |
| 76 | +### step 1 |
| 77 | + |
| 78 | +Make sure the [unit tests][jltest] and [CircleCI integration tests][circlecI] |
| 79 | +are passing. |
| 80 | + |
| 81 | +### step 2 |
| 82 | + |
| 83 | +Make a [PR][compare] with `master` as the _base_ branch and `dev` as _compare_ branch. |
| 84 | + |
| 85 | +For consistency, name the PR: "Release X.Y.Z" |
| 86 | + |
| 87 | +### step 3 |
| 88 | + |
| 89 | +Bump the `version` field in the `Project.toml` (following [semver][semver]) and then |
| 90 | + |
| 91 | +```sh |
| 92 | +git commit -m "X.Y.Z" |
| 93 | +``` |
| 94 | + |
| 95 | +**N.B.** use `X.Y.Z` not `vX.Y.Z` in the commit message, the leading `v` is |
| 96 | +reserved for git tags. |
| 97 | + |
| 98 | +### step 4 |
| 99 | + |
| 100 | +Wait for approval and then merge the PR onto `master`. |
| 101 | + |
| 102 | +### step 5 |
| 103 | + |
| 104 | +Navigate on GitHub to the merge commit from the `master` branch e.g. this |
| 105 | +[one][ex-commit] and then add the following comment: |
| 106 | + |
| 107 | +```sh |
| 108 | +@JuliaRegistrator register branch=master |
| 109 | +``` |
| 110 | + |
| 111 | +which tells the [Julia Registrator][registrator] to create a PR to the |
| 112 | +[General Registry][jgr] e.g. this [one][ex-jgr-pr]. |
| 113 | + |
| 114 | +### step 6 |
| 115 | + |
| 116 | +Wait for the Julia Registry PR to be merged. If things go well, this should be |
| 117 | +automatic! |
| 118 | + |
| 119 | +### step 7 |
| 120 | + |
| 121 | +Off `master`, create and push a new git tag with: |
| 122 | + |
| 123 | +```sh |
| 124 | +git checkout master |
| 125 | +git tag -a vX.Y.Z # N.B. leading `v` |
| 126 | +git push --tags |
| 127 | +``` |
| 128 | + |
| 129 | +### step 8 |
| 130 | + |
| 131 | +Go the [release page][releases] and create a new release, |
| 132 | +name it "Version X.Y.Z" for consistency and fill out sections: |
| 133 | + |
| 134 | +- _What's Changed_, which should include items for all the PRs merged since the last release |
| 135 | +- _New Contributor_, which should include mention of all the first-time contributors |
| 136 | + |
| 137 | +finally, place a [GitHub compare link][compare] between the last release and X.Y.Z |
| 138 | +e.g. this [one][ex-diff]. |
| 139 | + |
| 140 | +### step 9 |
| 141 | + |
| 142 | +you are done :tada: |
| 143 | + |
| 144 | +[jgr]: https://github.com/JuliaRegistries/General |
| 145 | +[juliaup]: https://github.com/JuliaLang/juliaup |
| 146 | +[testing]: https://dash.plotly.com/testing#end-to-end-tests |
| 147 | +[dash-cg]: https://github.com/plotly/dash/blob/dev/CONTRIBUTING.md#tests |
| 148 | +[resources]: ./gen_resources/README.md |
| 149 | +[docker-test]: ./build/README.md#local-usage |
| 150 | +[docker-update]: ./build/README.md#how-to-update-the-docker-image |
| 151 | +[lint]: ./.github/workflows/lint.yml |
| 152 | +[jltest]: https://github.com/plotly/Dash.jl/actions/workflows/jl_test.yml?query=branch%3Adev |
| 153 | +[circlecI]: https://app.circleci.com/pipelines/github/plotly/Dash.jl?branch=dev |
| 154 | +[semver]: https://pkgdocs.julialang.org/v1/toml-files/#The-version-field |
| 155 | +[registrator]: https://github.com/JuliaRegistries/Registrator.jl |
| 156 | +[releases]: https://github.com/plotly/Dash.jl/releases |
| 157 | +[compare]: https://github.com/plotly/Dash.jl/compare/ |
| 158 | +[ex-commit]: https://github.com/plotly/Dash.jl/commit/5ec76d9d3360f370097937efd06e5de5a6025888 |
| 159 | +[ex-jgr-pr]: https://github.com/JuliaRegistries/General/pull/77586 |
| 160 | +[ex-diff]: https://github.com/plotly/Dash.jl/compare/v1.1.2...v1.2.0 |
0 commit comments