Skip to content

Implementing New Sequence Number Management and Fixing how we get the extension Sequence Number#83

Merged
klugorosado merged 12 commits intomasterfrom
dev/klugorosado/fixProvisioning
Jun 28, 2024
Merged

Implementing New Sequence Number Management and Fixing how we get the extension Sequence Number#83
klugorosado merged 12 commits intomasterfrom
dev/klugorosado/fixProvisioning

Conversation

@klugorosado
Copy link
Collaborator

This pull request includes changes to the sequence number management and testing in the main and internal/seqno packages. The most important changes include the creation of a new SequenceNumberManager interface and SeqNumManager struct, 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 new SequenceNumberManager interface and SeqNumManager struct to manage sequence numbers. The SeqNumManager struct 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 main package:

  • main/cmds.go: a new function enablePre has 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 the mrseq file. This ensures orderly processing of sequence numbers.
  • main/main.go: Replaced the FindSeqNum function with seqnoManager.FindSeqNum to find the sequence number.
  • main/seqnum.go: Removed the FindSeqNum function as it has been replaced by seqnoManager.FindSeqNum.

New tests:

- 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`
@klugorosado klugorosado added bug Something isn't working enhancement New feature or request labels Jun 11, 2024
@klugorosado klugorosado self-assigned this Jun 11, 2024
@klugorosado klugorosado marked this pull request as ready for review June 11, 2024 21:59
@klugorosado klugorosado changed the base branch from feature/v2/bootstrapVMWatch to master June 13, 2024 19:57
@klugorosado
Copy link
Collaborator Author

retargeting to master

dependabot bot and others added 3 commits June 13, 2024 20:40
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>
Copy link
Collaborator

@frank-pang-msft frank-pang-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass

@klugorosado klugorosado merged commit cf66d11 into master Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants