Implementing New Sequence Number Management and Fixing how we get the extension Sequence Number#83
Merged
klugorosado merged 12 commits intomasterfrom Jun 28, 2024
Merged
Conversation
- This commit adds a new interface `SequenceNumberManager` and its implementation `SeqNumManager` in the `seqno` package. The interface defines methods for managing sequence numbers, including retrieving the current sequence number, getting the sequence number from a file, setting the sequence number, and finding the sequence number from the environment or a file. - Removed old implementation of seqno.
This commit adds the `enablePre` function to handle the processing of sequence numbers in the `enable` command. The function checks if the requested sequence number has already been processed and saves the sequence number before proceeding. New UTs are added in `cmds_test.go`
dpoole73
approved these changes
Jun 11, 2024
Collaborator
Author
|
retargeting to master |
Bumps google.golang.org/protobuf from 1.27.1 to 1.33.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
dpoole73
approved these changes
Jun 13, 2024
…execution when restarting.
frank-pang-msft
approved these changes
Jun 19, 2024
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.
This pull request includes changes to the sequence number management and testing in the
mainandinternal/seqnopackages. The most important changes include the creation of a newSequenceNumberManagerinterface andSeqNumManagerstruct, the addition of a function to check if a sequence number has already been processed before enabling it, and the addition of tests for the new function.New sequence number management:
internal/seqno/seqno.go: Created a newSequenceNumberManagerinterface andSeqNumManagerstruct to manage sequence numbers. TheSeqNumManagerstruct includes functions to get and set sequence numbers, and to find a sequence number from either the environment variable or the most recently used file under the config folder.Changes to
mainpackage:main/cmds.go: a new functionenablePrehas been added. This function, acting as the PreFunc for the enable command, verifies if the sequence number is ready for processing by comparing it with the last executed number from themrseqfile. This ensures orderly processing of sequence numbers.main/main.go: Replaced theFindSeqNumfunction withseqnoManager.FindSeqNumto find the sequence number.main/seqnum.go: Removed theFindSeqNumfunction as it has been replaced byseqnoManager.FindSeqNum.New tests:
main/cmds_test.go: Added tests for the enablePre.