Major upgrades
Major versions can contain incompatible changes. The following sections describe how to upgrade to a new major version.
Make sure to fix all deprecation warnings on the current version before attempting to upgrade.
Upgrading to 2025.2.x
Streamlined party model
The party model has been streamlined to make it easier to understand and use. The Party type has been simplified to
only contain a set of claims instead of separate "entity" and "access" claims. All claims now have essentially the
same semantics as the old "access" claims. Read more in
the Party type documentation and the
authorization documentation.
Migrating NPL code
Wherever you previously specified entity or access claims (or both), you should now just specify claims. Typically, this simply entails merging the two arguments into one at the call sites.
Migrating existing protocols
Generally, no action is required to migrate existing protocols. However, there are some edge cases where migrations may be needed prior to upgrading to 2025.2.x in order to change the party claims of existing protocols. This is needed if:
- There are protocols where the same key is used in both entity and access claims for a specific party
- There are multiple values for the same entity claim key in the entity claims of a party
Upgrading from 2024.2.x to 2025.1.x
This upgrade contained no incompatible changes.
Upgrading from 2024.1.x to 2024.2.x
Deployment
Database
- Make sure you are running PostgreSQL 14 or higher before upgrading.
- The Engine's database user no longer creates Read Model or History database users. Now all required database users
must be provided by the project configuration. Accordingly, the configuration of the Engine's database user can be
simplified (it no longer needs
CREATEROLEprivileges). Refer to the configuration section for more details. - The History database user no longer requires
CREATEROLEprivileges, so make sure to remove them. Details are provided in the configuration section. - The Read Model database user must be created and configured properly. Note that it does not need a
CREATEgrant on the database; it suffices to provide aCONNECTgrant. For more details, refer to the configuration section. - The
READ_MODEL_DB_URLenvironment variable, which replacesPOSTGRAPHILE_DB_URL, no longer accepts the Engine's database user credentials. Make sure to provide Read Model database user credentials instead.
Engine
- The
SWAGGER_ADMIN_URLenvironment variable is no longer supported. UseSWAGGER_ENGINE_ADMIN_URLinstead. - The
SWAGGER_MANAGEMENT_URLenvironment variable is no longer supported. UseSWAGGER_ENGINE_MANAGEMENT_URLinstead. - The
SWAGGER_KEYCLOAK_URLenvironment variable is no longer supported. UseSWAGGER_SECURITY_AUTH_URLinstead. - The
SWAGGER_KEYCLOAK_CLIENT_IDenvironment variable is no longer supported. UseSWAGGER_SECURITY_CLIENT_IDinstead. - The
SWAGGER_KEYCLOAK_CLIENT_SECRETenvironment variable is no longer supported. UseSWAGGER_SECURITY_CLIENT_SECRETinstead. - The
ENGINE_AUTH_SERVER_BASE_URLandJWT_TRUSTED_ISSUERSenvironment variables are no longer supported. UseENGINE_ALLOWED_ISSUERSinstead. - The
JWT_ISSUER_OVERRIDEenvironment variable is no longer supported. UseENGINE_ISSUER_OVERRIDEinstead. - The
ENGINE_DB_POOL_MAXIMUM_ACTIVE_CONNECTIONSenvironment variable is no longer supported. UseENGINE_DB_POOL_MAXIMUM_POOL_SIZEinstead. - The
ENGINE_DB_POOL_MAXIMUM_CHECKOUT_TIMEenvironment variable is no longer supported. UseENGINE_DB_POOL_MAXIMUM_CONNECTION_LIFETIMEinstead. - The
ENGINE_DB_POOL_MAXIMUM_IDLE_CONNECTIONSandENGINE_DB_POOL_TIME_TO_WAITenvironment variables have been removed (no substitutes). - The
ENGINE_DB_HISTORY_PASSWORDenvironment variable has been removed (no substitutes). - The
ENGINE_DB_POSTGRAPHILE_PASSWORDenvironment variable has been removed (no substitutes). - The
ENGINE_POSTGRAPHILE_DB_USERenvironment variable has been deprecated. UseENGINE_DB_READ_MODEL_USERinstead.
History
- The
SWAGGER_KEYCLOAK_URLenvironment variable is no longer supported. UseSWAGGER_SECURITY_AUTH_URLinstead. - The
SWAGGER_KEYCLOAK_CLIENT_IDenvironment variable is no longer supported. UseSWAGGER_SECURITY_CLIENT_IDinstead. - The
SWAGGER_KEYCLOAK_CLIENT_SECRETenvironment variable is no longer supported. UseSWAGGER_SECURITY_CLIENT_SECRETinstead. - The
HISTORY_DB_POOL_MAXIMUM_ACTIVE_CONNECTIONSenvironment variable is no longer supported. UseHISTORY_DB_POOL_MAXIMUM_POOL_SIZEinstead. - The
HISTORY_DB_POOL_MAXIMUM_CHECKOUT_TIMEenvironment variable is no longer supported. UseHISTORY_DB_POOL_MAXIMUM_CONNECTION_LIFETIMEinstead. - The
HISTORY_DB_POOL_MAXIMUM_IDLE_CONNECTIONSandHISTORY_DB_POOL_TIME_TO_WAITenvironment variables have been removed (no substitutes).
Read Model (previously "PostGraphile")
Everything related to "Postgraphile" is now called "Read Model" instead.
-
The Docker image has been renamed from
postgraphiletoread-model. -
The
POSTGRAPHILE_TRUSTED_ISSUERSenvironment variable is no longer supported. UseREAD_MODEL_ALLOWED_ISSUERSinstead. -
The
POSTGRAPHILE_PORTenvironment variable has been deprecated. UseREAD_MODEL_PORTinstead. - The
POSTGRAPHILE_DB_URLenvironment variable has been deprecated. UseREAD_MODEL_DB_URLinstead. - The
POSTGRAPHILE_DB_SCHEMAenvironment variable has been deprecated. UseREAD_MODEL_DB_SCHEMAinstead. - The
POSTGRAPHILE_DB_USERenvironment variable has been deprecated. UseREAD_MODEL_DB_USERinstead. - The
POSTGRAPHILE_ALLOWED_ISSUERSenvironment variable has been deprecated. UseREAD_MODEL_ALLOWED_ISSUERSinstead. - The
POSTGRAPHILE_ISSUER_OVERRIDEenvironment variable has been deprecated. UseREAD_MODEL_ISSUER_OVERRIDEinstead. - The
POSTGRAPHILE_ENGINE_HEALTH_ENDPOINTenvironment variable has been deprecated. UseREAD_MODEL_ENGINE_HEALTH_ENDPOINTinstead. - The
POSTGRAPHILE_ENGINE_HEALTH_TIMEOUT_SECONDSenvironment variable has been deprecated. UseREAD_MODEL_ENGINE_HEALTH_TIMEOUT_SECONDSinstead.
If you want to use a different name and password for the role currently assigned to POSTGRAPHILE_DB_USER, we suggest
that you rename both before bumping the Platform version.
You can use following commands for that:
alter role postgraphile with password <new_pwd>;
alter role postgraphile rename to <new_name>;
Tooling
Kotlin code generator
The Kotlin code generator has been deprecated. Use the NPL OpenAPI code generator instead, and then use the OpenAPI Generator Maven plugin or similar to generate client code in your desired language.
Upgrading from 2023.3.x to 2024.1.x
NPL
Option type
The Option type has now been completely removed, as have the related standard library methods optionalOf,
List.first(), List.indexOf(), List.last(), and Map.get().
If you still use Option in your code, you will need to migrate to Optional, and this can only be done with a
platform version between 2022.1.65 and 2023.3.x (i.e., you must migrate before upgrading to 2024.1.x). You can
use createOptional to replace values wrapped
with Option. ClientOptionValue and ApiOptionValue will remain (but are deprecated) in order to support reading
historical protocols.
The GraphQL Read Model no longer supports the isOption, structIsOption, or collectionIsOption field.
Migrating from Option to Optional
The following is an example of how option values can be replaced with optional values in a migration. Note that this will no longer work in 2024.1.x.
migration("Re-tag protocols to version 1.0.1")
.transformProtocol("/NPL-1.0.0?/app/LegacyProtocol", "/NPL-1.0.1?/app/LegacyProtocol") {
replace<OptionValue>("myField") { oldOption ->
createOptional(oldOption.value, TypeRef.numberValue)
}
replace<OptionValue>("myEmptyField") { oldOption ->
createOptional(oldOption.value, TypeRef.numberValue)
}
}
.retag(prototypes)
APIs
- The deprecated
meparameter in Engine Core and Streams API is no longer supported. Use the Admin API to obtain unauthorized streams. - The
guardoriginType in the schemas of Origin and GuardOrigin in Engine Core has been renamed to reflect the upcoming deprecation of theguardkeyword in NPL. The schemas userequireinstead.
Migrations
- The package
com.noumenadigital.dplno longer exists. Refer tocom.noumenadigital.nplinstead. - The migration utility function
mapPrototypesInUpshifthas been removed. The replacement functionmapPrototypesInMigrationshould be used instead.
Kotlin integration
- The
engine-clientandread-streams-clientpackages have been discontinued. Use the various clients in theclientspackage. - The
engine-client-authpackage no longer exists; its contents are now included in theclientspackage.
Deployment
Database
- Make sure you are running PostgreSQL 14 or higher before upgrading.
- Several columns have been removed from the database, but in order to benefit from the space savings, you will need
to manually run the
vacuumcommand on your database. We suggest that you do this during a scheduled maintenance window.
Engine
- The
JWT_TRUSTED_ISSUERSenvironment variable has been deprecated in favor ofENGINE_ALLOWED_ISSUERS. Whereas the deprecated version used prefix-matching to determine allowed issuers of JWT tokens, the new version uses exact matching to prevent unintentional matches. - The
JWT_ISSUER_OVERRIDEenvironment variable has been deprecated in favor ofENGINE_ISSUER_OVERRIDE. The behavior is unchanged.
Postgraphile
- The
POSTGRAPHILE_TRUSTED_ISSUERSenvironment variable has been deprecated in favor ofPOSTGRAPHILE_ALLOWED_ISSUERS. Whereas the deprecated version used prefix-matching to determine allowed issuers of JWT tokens, the new version uses exact matching to prevent unintentional matches.
Upgrading from 2023.2.x to 2023.3.x
Deployment
Engine
-
The
JVM_MAX_RAM_PERCENTAGEenvironment variable is no longer supported. Use the standardJAVA_TOOL_OPTIONSenvironment variable to modify Java settings.For example,
JVM_MAX_RAM_PERCENTAGE=25would translate toJAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=25". -
The
FEATURE_MIGRATION_DESCRIPTOR_NAME_BACKWARD_COMPATIBILITYfeature flag has been removed. Migration descriptors now must be calledmigration.ymlinstead ofupshift.yml. - The
FEATURE_APPLY_NPL_MIGRATIONS_AT_STARTUPfeature flag has been removed. If a migration is present in the directory indicated byENGINE_NPL_MIGRATION_DIRECTORY_PATHit will always be attempted. -
The
FEATURE_CODEGEN_EMPTY_STRUCT_STATIC_OBJECTfeature flag has been removed. Empty structs are now always static. -
The deprecated
ADMIN_HOSTvariable is no longer supported. UseENGINE_ADMIN_HOSTinstead. - The deprecated
ADMIN_PORTvariable is no longer supported. UseENGINE_ADMIN_PORTinstead. - The deprecated
APPLICATION_MANAGEMENT_HOSTvariable is no longer supported. UseENGINE_MANAGEMENT_HOSTinstead. - The deprecated
APPLICATION_MANAGEMENT_PORTvariable is no longer supported. UseENGINE_MANAGEMENT_PORTinstead. - The deprecated
APPLICATION_MANAGEMENT_ARCHIVE_SIZE_LIMITvariable is no longer supported. UseENGINE_MANAGEMENT_ARCHIVE_SIZE_LIMITinstead. - The deprecated
POSTGRAPHILE_DB_USERvariable is no longer supported. UseENGINE_DB_POSTGRAPHILE_USERinstead. - The deprecated
POSTGRAPHILE_DB_PASSWORDvariable is no longer supported. UseENGINE_DB_POSTGRAPHILE_PASSWORDinstead. It also no longer has a default value. It now has to be set explicitly. - The deprecated
ENGINE_NPL_MIGRATION_DIRECTORYPATHvariable is no longer supported. UseENGINE_NPL_MIGRATION_DIRECTORY_PATHinstead. - The deprecated
ENGINE_NPL_MIGRATION_RUNONLYvariable is no longer supported. UseENGINE_NPL_MIGRATION_RUN_ONLYinstead. - The deprecated
ENGINE_ACTUATOR_EXPOSEvariable is no longer supported. UseENGINE_SPRING_ACTUATOR_EXPOSEinstead. - The
ENGINE_DB_PASSWORDvariable no longer has a default value. It now has to be set explicitly.
History
- The
JVM_MAX_RAM_PERCENTAGEenvironment variable is no longer supported. Use the standardJAVA_TOOL_OPTIONSenvironment variable to modify Java settings. - The
HISTORY_DB_PASSWORDvariable no longer has a default value. It now has to be set explicitly.
Postgraphile
- The
DATABASE_URLenvironment variable is no longer supported. UsePOSTGRAPHILE_DB_URLinstead. - The
ENGINE_HEALTH_ENDPOINTenvironment variable is no longer supported. UsePOSTGRAPHILE_ENGINE_HEALTH_ENDPOINTinstead. - The
ENGINE_TIMEOUT_SECONDSenvironment variable is no longer supported. UsePOSTGRAPHILE_ENGINE_HEALTH_TIMEOUT_SECONDSinstead. - The
ISSUER_OVERRIDEenvironment variable is no longer supported. UsePOSTGRAPHILE_ISSUER_OVERRIDEinstead. - The
PORTenvironment variable is no longer supported. UsePOSTGRAPHILE_PORTinstead. - The
SCHEMAenvironment variable is no longer supported. UsePOSTGRAPHILE_DB_SCHEMAinstead. - The
TRUSTED_ISSUERSenvironment variable is no longer supported. UsePOSTGRAPHILE_TRUSTED_ISSUERSinstead.
Upgrading from 2023.1.x to 2023.2.x
This upgrade contained no incompatible changes.