Repository navigation
Introduce Ranger ID V2 generation API in ranger-id (2.x) - #123
Merged
Merged
Conversation
Refactored nonce generator
Keeps new V2 benchmark files; reverts version bump (1.1.3-ID-V2-RC1 → 1.1.4) and any changes to existing IdGeneratorPerfTest to reduce diff noise in PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…V1 compat base36() was dropped during id-v2 redesign but IdGeneratorPerfTest (from main) references it. Re-implement against the new IdFormatter interface by wrapping DefaultIdFormatter and base36-encoding its numeric output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
base36() was intentionally removed in id-v2. Keep id-v2 version of IdGeneratorPerfTest rather than forcing compatibility with main's version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addressed comments
- IdValidationConstraint: restore isValid(Id) as the abstract method (binary-compat break flagged in review); isValid(InternalId) is now a default bridging via toInternalId()/toId() helpers - GenerationResult: document as internal-only (not public API contract) - IdFormatter: add id() so IdGeneratorType.LOOKUP_MAP keys off a stable identifier instead of formatter object identity, which only worked for the cached IdFormatters singletons - IdParsersV2: comment DEFAULT_PATTERN's two-step V1/V2 disambiguation - NodeUtils: add reset(), called from IdGenerator/IdGeneratorV2 cleanUp() so a stale node id isn't silently reused by a later initialize() that forgets to call setNode() again - add missing Apache license headers on 9 files - drop stale @SneakyThrows from perf benchmarks, unused import in IdParsersV2Test, deprecate unused IdGenerationRequest - add IdGeneratorV2Test covering the (asymmetric) V2->legacy parse interop contract Refs review comments on #109 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removed InternalId method in interface
Keep V1 and V2 generators on the same process-level node while allowing idempotent startup calls. Reset remains the explicit lifecycle boundary.
Resolve equivalent formatter instances without adding an internal lookup identifier to the public IdFormatter contract.
fix(id): address Santanu's review feedback on #109
Keep the shared node reserved until all initialized generators stop. Snapshot request lists so builder reuse cannot change encoded formats. Reject partial IDs and invalid suffixes; join test workers before cleanup. V2 requests no longer expose setConstraints; use the builder instead. NodeUtils.reset rejects resets while a generator remains initialized.
Merges origin/id-v2 (e529804) into origin/2.x with semantic conflict resolution: - V2 API ported into io.appform.ranger.id: IdGeneratorV2, IdGenerationRequestV2/InternalRequest, IdGeneratorType, decorators (Base36IdDecorator replaces Base36IdFormatter), IdParsersV2, FormattedId/InternalId pipeline, NonceUtils/NonceGenerators. - 2.x preserved: module layout, 2.0.0-RC6 versions, nanosecond collision-checker fixes, discovery-core structure, dw5 variants. - V1 IdGenerator public surface kept, backed by V2 internals. - Lifecycle: NodeUtils (single home in ranger-id) + NodeIdManager; ServiceDiscoveryBundle (dw + dw5) initializes both generators. - Removed legacy: Base36IdFormatter, DefaultIdGenerator, IdParserType. Validation: full reactor build green; 185 tests, 0 failures across all modules including ranger-id (65) and both discovery bundle variants (16/16).
Bump project version 2.0.0-RC6 -> 2.0.0-RC7 across all 24 reactor POMs (root, ranger-parent, ranger-bom, and module parent references). Full reactor 'mvn install -DskipTests' passes.
|
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.



Summary
Introduces the new Ranger ID V2 generation API in the
ranger-idmodule for the 2.x release line. ID V2 was never merged into 1.x; this is a new feature/change designed for Ranger 2.x, superseding the design work explored in #109 (this is not a port or merge of another branch into 2.x).The new API is exposed as
io.appform.ranger.id.IdGeneratorV2alongside the existingIdGenerator:IdGeneratorV2with random nonce support, base36 handled via decorators (IdDecorators.base36()), and suffix support.IdParsersV2requires full-input matches and validates the suffix grammar.NodeUtils.setNode(...)with synchronized access and consistent cleanup.IdGeneratorpublic surface is largely preserved, now backed by the V2 internals.ServiceDiscoveryBundle) initialize and clean up bothIdGeneratorandIdGeneratorV2.Breaking changes (explicit list)
IdGenerator.generate(IdGenerationRequest)removed;IdGenerationRequestis deprecated for removal.IdFormatterinterface changed:getType()removed;format(nodeId, IdGenerationInput)now returnsFormattedId.Domainno longer carries anidFormatter.IdGenerator.initialize(int, List, Map)removed in favor ofinitialize(List, Map)+NodeUtils.setNode(...).Base36IdFormatter,IdFormatters.base36(),IdParserType, andDefaultIdGeneratorremoved (replaced by decorators).GenerationResultreshaped (now carries the internal ID pipeline).Validation
mvn install -DskipTests: BUILD SUCCESSmvn test: 185 tests, 0 failures, 0 errorsranger-id: 65 tests greenranger-discovery-bundleandranger-discovery-dw5-bundle: 16/16 green eachNotes
2.x(a non-default branch). Closing keywords in this description do not auto-close issues; any related issue must be closed manually after merge.