@@ -842,20 +842,261 @@ its documentation needs to be marked as such. For the respective version, set
842842the `deprecated` attribute to `true` in the `site/data/versions.yaml` file :
843843
844844` ` ` diff
845- - name: ' 3.10'
846- version: ' 3.10.9'
847- alias: ""
845+ - name: " 3.10"
846+ version: " 3.10.9"
847+ alias: "3.10 "
848848- deprecated: false
849849+ deprecated: true
850850` ` `
851851
852852It makes a warning show at the top of every page for that version.
853853
854- <!--
855854# ## Add a new version
856855
857- TODO : Pending CircleCI dynamic config
858- -->
856+ 1. In the `site/data/versions.yaml` file, add a new entry for the version you
857+ want to add. Example :
858+
859+ ` ` ` diff
860+ +- name: "4.0"
861+ + version: "4.0.0"
862+ + alias: "4.0"
863+ + deprecated: false
864+ +
865+ - name: "3.12"
866+ version: "3.12.0"
867+ alias: "devel"
868+ deprecated: false
869+ ` ` `
870+
871+ 2. Near the top of the `.circleci/config.yml` file under `parameters`, find the
872+ last entry with the format `arangodb-X_XX` where `X_XX` is a version number
873+ like `3_12`, so `arangodb-3_12` for example. Duplicate the block and adjust
874+ the version number. Example :
875+
876+ ` ` ` diff
877+ arangodb-3_12:
878+ type: string
879+ default: "undefined"
880+ +
881+ + arangodb-4_0:
882+ + type: string
883+ + default: "undefined"
884+ ` ` `
885+
886+ Near the end of the file under `jobs.generate-config.steps[0].run.command`,
887+ find the line of code that calls `python3 generate_config.py`. In one of the
888+ following lines, a parameter for every version is passed as argument. Add one
889+ for the new version. Example :
890+
891+ ` ` ` diff
892+ python3 generate_config.py \
893+ --workflow << pipeline.parameters.workflow >> \
894+ - --arangodb-branches << pipeline.parameters.arangodb-3_11 >> << pipeline.parameters.arangodb-3_12 >> \
895+ + --arangodb-branches << pipeline.parameters.arangodb-3_11 >> << pipeline.parameters.arangodb-3_12 >> << pipeline.parameters.arangodb-4_0 >> \
896+ ` ` `
897+
898+ 3. In the `toolchain/docker/amd64/docker-compose.yml` file, add an entry under
899+ ` services.toolchain.volumes` for the new version. Simply increment the value
900+ after `:-/tmp/`. Example :
901+
902+ ` ` ` diff
903+ - ${ARANGODB_SRC_3_12:-/tmp/2}:/tmp/3.12
904+ + - ${ARANGODB_SRC_4_0:-/tmp/3}:/tmp/4.0
905+ ` ` `
906+
907+ Under `services.toolchain.environment`, you need to add two different entries
908+ for the new version. Example :
909+
910+ ` ` ` diff
911+ ARANGODB_SRC_3_11: ${ARANGODB_SRC_3_11}
912+ ARANGODB_SRC_3_12: ${ARANGODB_SRC_3_12}
913+ + ARANGODB_SRC_4_0: ${ARANGODB_SRC_4_0}
914+ ARANGODB_BRANCH_3_11: ${ARANGODB_BRANCH_3_11}
915+ ARANGODB_BRANCH_3_12: ${ARANGODB_BRANCH_3_12}
916+ + ARANGODB_BRANCH_4_0: ${ARANGODB_BRANCH_4_0}
917+ ` ` `
918+
919+ The same changes are required in the
920+ ` toolchain/docker/arm64/docker-compose.yml` file.
921+
922+ 4. In the `toolchain/docker/config.yaml` file, add an entry for the new version.
923+ Example :
924+
925+ ` ` ` diff
926+ - image: ${ARANGODB_BRANCH_3_12_IMAGE}
927+ version: ${ARANGODB_BRANCH_3_12_VERSION}
928+ +
929+ + - image: ${ARANGODB_BRANCH_4_0_IMAGE}
930+ + version: ${ARANGODB_BRANCH_4_0_VERSION}
931+ ` ` `
932+
933+ 5. In the `toolchain/scripts/toolchain.sh` file, find the code that accesses
934+ environment variables with the format `$ARANGODB_BRANCH_X_XX` where `X_XX`
935+ is a version number like `3_12`, so `$ARANGODB_BRANCH_3_12` for instance.
936+ Duplicate the block of an existing version and adjust all version numbers.
937+ Example :
938+
939+ ` ` ` diff
940+ if [ "$ARANGODB_BRANCH_3_12" != "" ] ; then
941+ export ARANGODB_BRANCH_3_12_IMAGE="$ARANGODB_BRANCH_3_12"
942+ export ARANGODB_BRANCH_3_12_VERSION="3.12"
943+ fi
944+
945+ +if [ "$ARANGODB_BRANCH_4_0" != "" ] ; then
946+ + export ARANGODB_BRANCH_4_0_IMAGE="$ARANGODB_BRANCH_4_0"
947+ + export ARANGODB_BRANCH_4_0_VERSION="4.0"
948+ +fi
949+ ` ` `
950+
951+ 6. In the `site/data` folder, create a new folder with the short version number
952+ as the name, e.g. `4.0`. In the new `site/data/4.0` folder, create a
953+ `cache.json` file with the following content :
954+
955+ ` ` ` json
956+ {}
957+ ` ` `
958+
959+ Add this untracked file to Git!
960+
961+ 7. Duplicate the folder of the most recent version in `site/content`, e.g.
962+ the `3.12` folder, and rename the copy to the new version, e.g. `4.0`.
963+
964+ The `menuTitle` in the front matter of the version homepage, e.g.
965+ ` site/content/4.0/_index.md` , needs to adjusted to the new version,
966+ like `menuTitle : ' 4.0' ` .
967+
968+ In the folder for release notes, e.g. ` site/content/4.0/release-notes/`,
969+ duplicate the folder of the most recent version, e.g. `version-3.12`, and
970+ rename it, e.g. to `version-4.0`. In this folder, rename the files to replace
971+ the old with the new version number, e.g. `api-changes-in-3-12.md` to
972+ ` api-changes-in-4-0.md` and so on.
973+
974+ In the `_index.md` file in the folder, e.g.
975+ ` site/content/4.0/release-notes/version-4.0/_index.md` , you need to replace
976+ the version numbers in the front matter and links. You also need to adjust
977+ the `weight` in the front matter. Decrement the value by one to make the new
978+ version appear before the existing versions, but make sure that it is greater
979+ than `0`, which may require adjusting the weights in all of the section files.
980+
981+ In the other files of the release notes, remove the version-specific content
982+ and only leave the front matter, introductions, and headlines that are
983+ commonly used across different versions in the release notes. Adjust the
984+ version numbers in the front matter and content.
985+
986+ Search the entire version folder, e.g. `site/content/4.0/`, for links that
987+ are meant to point to the release notes of the own version, but which are
988+ still pointing to the version the content has been copied from. For example,
989+ if you duplicated the `3.12` folder, search the `4.0` folder for
990+ ` version-3.12/` . You should find links to `version-3.12/known-issues-in-3-12.md`
991+ that need to be updated to `version-4.0/known-issues-in-4-0.md`.
992+
993+ In the release notes root file, e.g. `site/content/4.0/release-notes/_index.md`,
994+ add the links for the new version following the existing pattern. Do this
995+ after updating the links to the known issues so that you don't accidentally
996+ change the 3.12 link in the release notes root file.
997+
998+ In the _Highlights by Version_ page, e.g.
999+ ` site/content/4.0/introduction/features/highlights-by-version.md` , add a
1000+ section for the new version including a link to the release notes.
1001+
1002+ Add the new, untracked files to Git!
1003+
1004+ 8. In the `PULL_REQUEST_TEMPLATE.md` file, add a new line for the new version.
1005+ Example :
1006+
1007+ ` ` ` diff
1008+ - 3.12:
1009+ +- 4.0:
1010+ ` ` `
1011+
1012+ Stage all changes and commit them. Open a pull request (PR) on GitHub. You only
1013+ need to specify a Docker image or PR link for `- 4.0 : ` if you plan to use
1014+ the ` /generate` or `/generate-commit` command to re-generate the examples.
1015+ If you follow the next step, the example generation is run manually along
1016+ with some other generators, so using the commands shouldn't be necessary.
1017+
1018+ Expect the plain build to fail for the time being because of missing data files.
1019+
1020+ 9. You can use CircleCI to initially generate the data files for the new version,
1021+ like the startup option dumps. You can also populate the example cache at the
1022+ same time.
1023+
1024+ Before you continue, make sure there are no conflicts in the PR with the
1025+ ` main` branch. The CircleCI workflow will otherwise create a merge commit
1026+ favoring the `main` branch (in order to update the cache file but also
1027+ affecting other files), and this can cause e.g. the `versions.yaml` file to
1028+ get reverted in case of a conflict. The toolchain would then be unaware of
1029+ the newly added version.
1030+
1031+ In CircleCI at <https://app.circleci.com/pipelines/github/arangodb/docs-hugo>,
1032+ select the branch of your PR and click **Trigger Pipeline**.
1033+ Enter the parameters similar to this example :
1034+
1035+ | Type | Name | Value |
1036+ |:-----|:-----|:------|
1037+ | string | `workflow` | `generate` |
1038+ | string | `arangodb-4_0` | Docker Hub image (e.g. `arangodb/enterprise-preview:devel-nightly`) or GitHub main repo PR link (e.g. `https://github.com/arangodb/arangodb/pull/123456`) |
1039+ | string | `generators` | `examples metrics error-codes optimizer options` |
1040+ | string | `deploy-url` | `deploy-preview-{PR-number}` with the number of the docs PR |
1041+ | boolean | `commit-generated` | `true` |
1042+
1043+ Approve the workflow in CircleCI. After a successful run, you should see a
1044+ commit in the docs PR with the updated data files, as well as an updated
1045+ example cache file. The plain build should no longer fail and provide you
1046+ with a Netlify preview.
1047+
1048+ # ## Remove a version
1049+
1050+ The process is similar to [adding a version](#add-a-new-version) but you need to
1051+ undo the changes.
1052+
1053+ # ## Change the stable version
1054+
1055+ For example, if the current stable version is 3.11 and the devel version is 3.12,
1056+ the `site/data/versions.yaml` file may look like this :
1057+
1058+ ` ` ` yaml
1059+ - name: "4.0"
1060+ version: "4.0.0"
1061+ alias: "4.0"
1062+ deprecated: false
1063+
1064+ - name: "3.12"
1065+ version: "3.12.0"
1066+ alias: "devel"
1067+ deprecated: false
1068+
1069+ - name: "3.11"
1070+ version: "3.11.4"
1071+ alias: "stable"
1072+ deprecated: false
1073+ ` ` `
1074+
1075+ To make 3.12 the new stable version, you need to set `alias` to `"stable"` for
1076+ the 3.12 entry. As there can only be a single stable version (in the
1077+ documentation sense), the `alias` value of the former stable version needs to be
1078+ changed. In this example, it is the 3.11 entry where you need to change `alias`
1079+ to the version `name`, which is `"3.11"` in this case. Finally, you need to
1080+ re-assign the `"devel"` alias to the version that comes after the new stable
1081+ version. In this example, you need to adjust the `alias` of the 4.0 entry.
1082+ The final configuration would then look lik this :
1083+
1084+ ` ` ` yaml
1085+ - name: "4.0"
1086+ version: "4.0.0"
1087+ alias: "devel" # was "4.0"
1088+ deprecated: false
1089+
1090+ - name: "3.12"
1091+ version: "3.12.0"
1092+ alias: "stable" # was "devel"
1093+ deprecated: false
1094+
1095+ - name: "3.11"
1096+ version: "3.11.4"
1097+ alias: "3.11" # was "stable"
1098+ deprecated: false
1099+ ` ` `
8591100
8601101# ## Add a new arangosh example
8611102
0 commit comments