Skip to content

Enhance list-checkpoints CLI #3746

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

Merged

Conversation

xincunli-sonic
Copy link
Contributor

@xincunli-sonic xincunli-sonic commented Jan 31, 2025

What I did

Add a new parameter -t to add last modify datetime of each checkpoint to the list-checkpoint CLI.

ADO: 30788686

How I did it

Read each checkpoint file last modify time, return checkpoint name and its last modify datetime

[
    {"name": "checkpoint1", "time": "timestamp"},
    {"name": "checkpoint2", "time": "timestamp"}
]

How to verify it

Applied change to lab device, then run sudo config list-checkpoints

Previous command output (if the output of a command-line utility has changed)

admin@str2-7250-lc1-2:~/xincun$ sudo config list-checkpoints
[
    "xincun2",
    "xincun1"
]

New command output (if the output of a command-line utility has changed)

admin@str2-7250-lc1-2:~/xincun$ sudo config list-checkpoints
[
    "xincun2",
    "xincun1"
]
admin@str2-7250-lc1-2:~/xincun$ sudo config list-checkpoints -t
[
    {
        "name": "xincun2",
        "time": "2025-02-11T00:55:06.521339+00:00"
    },
    {
        "name": "xincun1",
        "time": "2025-02-11T00:54:45.803878+00:00"
    }
]

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xincunli-sonic xincunli-sonic changed the title Add datetime to list checkpoints Enhance list-checkpoints CLI Jan 31, 2025
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Pull request contains merge conflicts.

@xincunli-sonic
Copy link
Contributor Author

/azp run

Copy link

Pull request contains merge conflicts.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@wen587 wen587 left a comment

Choose a reason for hiding this comment

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

lgtm

@xincunli-sonic xincunli-sonic merged commit d6e1bf4 into sonic-net:master Mar 5, 2025
7 checks passed
nmoray pushed a commit to nmoray/sonic-utilities that referenced this pull request Jun 25, 2025
* Add datetime to list checkpoints

* fix format

* remove unused import

* fix import

* fix CHECKPOINTS_DIR

* fix getmtime mock

* Add a parameter to include modify time.

* Fix UT

* Fix test

* Fix UT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants