This document describes how to update dependencies in ZAC and (OpenAPI) API specifications used by ZAC.
This is normally done by Renovate using the installed github app in in the project. This includes updating of backend (Java), frontend (TypeScript) as well as GitHub Action and Docker dependencies.
This is done by Renovate and its configuration file renovate.json. The version restrictions are following PodiumD 2.0 development.
The configuration inherits from base settings provided by Renovate, which lay the groundwork for handling updates in a standardized manner. It includes logic to handle major version updates separately and automerges certain updates to reduce manual interventions.
- Pinning Docker Digests: This strategy involves locking Docker images to specific digests. Pinned digests help eliminate the risk of unexpected updates that could introduce breaking changes or vulnerabilities, as you always use a known working image version.
- Scheduled Digest Updates: Even with pinned digests, it's important to periodically update them to include the latest security patches and features. Therefore, Renovate is configured to check for and apply digest updates weekly during the first week of each month's weekends. These digest updates are configured to be automerged.
ZAC integrates with various components and external services using APIs. Most of these APIs are defined by OpenAPI specifications. These OpenAPI specifications are used in the ZAC build process to automatically generate ZAC client code (with a few exceptions). The OpenAPI specifications that are used for this client code generation can be found in the api-secs folder.
To update these OpenAPI specification, follow these steps:
- Obtain the version (YAML file) of the OpenAPI specification in question.
- For the ZGW APIs you can find these specifications from a running OpenZaak instance
by following the
Components
links on the OpenZaak homepage. - Now follow the
API specificaties
link. - Now manually append the string
openapi.yaml
to the URL in the browser. The URL will now be something like:https://<open-zaak-url>/zaken/api/v1/schema/openapi.yaml
and press enter. - A download of the OpenAPI specification will start.
- For the ZGW APIs you can find these specifications from a running OpenZaak instance
by following the
- Replace the existing OpenAPI specification in the api-secs folder with the new version.
- Do a diff of the newly generated OpenAPI specification with the current version and make sure that
any manual changes that were made to the current version are also made to the new version (if they still apply).
These manual changes are indicated with a code comment containing the term
Lifely
. Some of these manual changes include:- Added
readOnly: false
attributes to properties that were missing a setter (or constructor) in the generated Java client code but which need to be set by ZAC. - Added empty values to certain enumerations to allow for empty (string) values in the HTTP responses of certain OpenZaak requests.
- Added
- Regenerate the Java client code. This can be done by running the following Gradle task:
This will generate the Java client code in the src/generated subfolders.
./gradlew clean generateJavaClients
- Check if ZAC still compiles and runs correctly and all automated tests succeed.
- Manually test the functionality that uses the updated API where automated test coverage is lacking.
ZAC uses the Material Design Icons and Google Fonts libraries, but we host them locally to prevent external dependencies.
The css of all icons and fonts is located in src/main/app/src/styles.less file. All assets are located in the src/main/app/src/assets folder.
When updating the icons or fonts, make sure to update the css and assets accordingly. We only load in the fonts we actually need so we are not sending unnecessary data to the client.
If you need a new font-weight for example, you can find the css and assets for the roboto font here https://fonts.googleapis.com/css?family=Roboto, then you can copy paste the css and download the assets and add them to the project.
ZAC runs in the WildFly Java application server. To upgrade the WildFly version, follow these steps:
- Check the WildFly release notes.
- Upgrade WildFly in the Maven build file. This is the actual WildFly that gets used in the ZAC Docker Image. Also check if the Maven WildFly plugins we use need to be updated.
- The WildFly version from the Maven build file will be used by the WildFly install script.
- Check if WildFly's Galleon tooling needs to be updated. This is used to configure the locally installed WildFly. To upgrade override the Galleon files in the Galleon install folder with the new version.
- Re-install your local WildFly version using the WildFly install script.
- If you have configured your IntelliJ IDE to run ZAC in WildFly update the IntelliJ WildFly run configuration using the instructions in INSTALL.md.
- In the Gradle Versions Catalog file manually upgrade all the 'dependencies provided by Wildfly' that are used in the Gradle build file. These need to be in sync with the ones provided by the used version of WildFly.
- Test ZAC thoroughly to make sure everything still works both by running ZAC locally (in IntelliJ and in Docker Compose) and performing manual testing as well as by running our automated tests.
- Once everything works tell all your co-developers to upgrade their local WildFly installations and IntelliJ WildFly configurations as well.
Renovate creates pull requests for all Angular dependencies that are behind, but Angular dependencies have to be updated in a specific order and angular provides migration tools with ng update
.
So for Angular dependencies we have to update them manually and commit them to the repository, then Renovate will remove its pull requests.
- You need to have the Angular command line tools installed locally. Do install these on a Mac you can use
brew install angular-cli
Run the following command to update Angular dependencies from the ZAC frontend folder:
ng update
This command will check whatever angular packages are behind and could result in a list of packages to update like:
Then you can run one of the commands in the list like:
ng update @angular/core
Make sure to commit every update command you run with a format like:
git add .
git commit -m "update @angular/core to [version]"