Making id and name length configrable so that id and name can be set larger than 128 and 256 respectively#200
Conversation
added 3 commits
March 31, 2026 13:06
…larger than 128 and 256 respectively
akashdw
reviewed
Mar 31, 2026
rdeepak2002
reviewed
Apr 1, 2026
added 4 commits
April 1, 2026 13:29
…eck. Size check is applicable for Workflow and Abstract Step name. While pattern check is for Tag.name, SignalCreateRequest.name and SignalInstance.name
akashdw
reviewed
Apr 6, 2026
| import com.netflix.maestro.models.Constants; | ||
|
|
||
| /** Interface exposing configurable validation limits used by constraint validators. */ | ||
| public interface ValidationLimits { |
Collaborator
There was a problem hiding this comment.
May be MaestroNameIdValidationLimits or MaestroNameIdValidationConfigs
akashdw
reviewed
Apr 6, 2026
…ttern check. Size check is applicable for Workflow and Abstract Step name. While pattern check is for Tag.name, SignalCreateRequest.name and SignalInstance.name" This reverts commit c360a81. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
akashdw
approved these changes
Apr 7, 2026
praneethy91
approved these changes
Apr 7, 2026
Collaborator
praneethy91
left a comment
There was a problem hiding this comment.
LGTM, thanks for making the changes!
rdeepak2002
approved these changes
Apr 7, 2026
Collaborator
rdeepak2002
left a comment
There was a problem hiding this comment.
Latest changes lgtm and are well-tested, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request type
./gradlew build --write-locksto refresh dependencies)NOTE: Please remember to run
./gradlew spotlessApplyto fix any format violations.Describe the new behavior from this PR, and why it's needed
Maestro's ID and name length limits (128 and 256 respectively) are currently compile-time constants. This PR makes them configurable at runtime via application config, with defaults that preserve existing behavior for all deployments that do not explicitly override them.
Motivation: Some workflows migrated from Airflow have DAG IDs up to 226 characters and task IDs up to 249 characters. The database already supports larger sizes; only the application validation layer needs updating.
No default behavior change: If
maestro.maestro-id-name-validationis not set in config, limits default to exactly the same values as before (128 for IDs, 256 for names). Existing deployments are unaffected.Changes in this PR
maestro-common
MaestroIdNameValidationLimitsinterface (incom.netflix.maestro.utils) exposinggetIdLengthLimit()andgetNameLengthLimit(). Includes aDEFAULTSconstant (backed byConstants) used as a fallback when the interface is not injected (e.g. unit tests without Spring).MaestroNameSizeConstraint— a null-safe, length-only annotation that replaces@Size(max = Constants.NAME_LENGTH_LIMIT)on optional name fields (Workflow.name,AbstractStep.name) where the limit must be configurable at runtime.MaestroIdConstraint,MaestroNameConstraint,MaestroReferenceIdConstraint, andMaestroNameSizeConstraintto injectMaestroIdNameValidationLimitsvia@Inject(same pattern asAlertingValidatorinPropertiesConstraint). Each validator falls back toMaestroIdNameValidationLimits.DEFAULTSwhen not injected.maestro-server
MaestroIdNameValidationProperties— Spring@ConfigurationPropertiesbound undermaestro.maestro-id-name-validation.*, implementingMaestroIdNameValidationLimits. Field-level defaults matchConstants, so any unconfigured limit automatically retains its original value independently (e.g. configuring onlyid-length-limitleavesname-length-limitat 256).MaestroIdNameValidationConfiguration— exposesMaestroIdNameValidationPropertiesas aMaestroIdNameValidationLimitsSpring@Beanso validators can inject it.MaestroIdNameValidationPropertiesintoMaestroProperties.Tests
MaestroIdNameValidationLimitsTestcovering each constraint (MaestroIdConstraint,MaestroNameConstraint,MaestroReferenceIdConstraint,MaestroNameSizeConstraint) with a customConstraintValidatorFactorythat injects arbitraryMaestroIdNameValidationLimitsvia reflection on@Injectfields — no Spring context required.MaestroIdConstraintTest,MaestroNameConstraintTest,MaestroReferenceIdConstraintTestto referenceConstantsdirectly instead of the old static holder.Testing done:
Unit tests are passing.
Verified in local Maestro server by setting id and name limit to 200 and creating a dag with smaller and larger length than that.
Note: The limit is fully configurable via
maestro.maestro-id-name-validation.id-length-limitandmaestro.maestro-id-name-validation.name-length-limitinapplication.yml, with no code changes required.