-
Notifications
You must be signed in to change notification settings - Fork 2
Add Document and DocumentRevision Controllers with Unit Tests #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JoseSzycho
wants to merge
15
commits into
integration/agreements-api
Choose a base branch
from
feat/agreements-controllers
base: integration/agreements-api
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Document and DocumentRevision Controllers with Unit Tests #336
JoseSzycho
wants to merge
15
commits into
integration/agreements-api
from
feat/agreements-controllers
Conversation
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
…ment and DocumentRevision resources This commit introduces the DocumentController, which manages the reconciliation of Document objects and their associated DocumentRevisions. It includes logic to update the document's status based on the presence of revisions, ensuring the LatestRevisionRef is correctly set. Additionally, unit tests for the DocumentController's reconciliation process are added to verify functionality.
…it tests This commit introduces the DocumentRevisionController, which manages the reconciliation of DocumentRevision resources. It includes logic to calculate and persist a content hash, ensuring that updates to the document's content do not change the hash if the document is already reconciled. Additionally, unit tests are added to verify the reconciliation behavior of the controller.
Contributor
…ner references during updates
…djust owner references during updates" This reverts commit 75fb8a3.
…ple configurations This commit introduces two new Custom Resource Definitions (CRDs): PlatformAccessApproval and PlatformInvitation. The PlatformAccessApproval CRD allows for managing access approvals for users, while the PlatformInvitation CRD facilitates inviting users to the platform. Sample configurations for both CRDs are included, along with necessary updates to the kustomization file to include these new resources.
…latformInvitation CRDs with sample configurations" This reverts commit 269f325.
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.
Description:
This PR adds two new controllers for the Documentation API group:
DocumentController
Reconciles the
Documentresource status, including updating itsLatestRevisionRefand setting the Ready condition based on the associatedDocumentRevisionobjects. This ensures each document always reflects its most current revision, or clears the reference if no revisions are present.DocumentRevisionController
Reconciles the
DocumentRevisionresource status by computing and storing a SHA-256 hash of the revision content. Once the resource has been successfully processed, the Ready condition is set toTrue. The content hash allows for detecting changes and ensures idempotency.Both controllers are covered by dedicated unit tests validating their core reconciliation logic and edge case handling.