Skip to content

Add system-version to omdb db #10481

Open
emunn13 wants to merge 4 commits into
mainfrom
emunn/omdb-db-system-version
Open

Add system-version to omdb db #10481
emunn13 wants to merge 4 commits into
mainfrom
emunn/omdb-db-system-version

Conversation

@emunn13
Copy link
Copy Markdown

@emunn13 emunn13 commented May 22, 2026

Add system-version subcommand to omdb db to print the current system version and when this version update was requested.
Also add --all, to print all system versions and their requested dates.

Copy link
Copy Markdown
Contributor

@karencfv karencfv left a comment

Choose a reason for hiding this comment

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

This is great! Thanks for working on this command.

Comment thread dev-tools/omdb/src/bin/omdb/db.rs Outdated
Comment on lines +409 to +410
/// Print the current target system release and the update date (print all of the releases when `--all` is present)
SystemVersion(system_version::SystemVersionArgs),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not all components may be at the target release version at any given time. Having a "system-version" command could be confusing. It's probably more accurate to call it "target-release" :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks so much for the review, appreciate it :) I've changed it to target-release.

Comment thread dev-tools/omdb/src/bin/omdb/db.rs Outdated
Sleds(SledsArgs),
/// Show instances grouped by the sled they are running on
SledInstances(SledInstancesArgs),
/// Print the current target system release and the update date (print all of the releases when `--all` is present)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We typically don't mention command flags in the doc string.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you! Addressed in commit 1746781

@emunn13
Copy link
Copy Markdown
Author

emunn13 commented May 22, 2026

Tested the generated binary on dogfood:

omdb db target-release

root@oxz_switch0:/tmp# ./omdb-test db target-release
note: database URL not specified.  Will search DNS.
note: (override with --db-url or OMDB_DB_URL)
note: using DNS from system config (typically /etc/resolv.conf)
note: (if this is not right, use --dns-server to specify an alternate DNS server)
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221,[fd00:1122:3344:105::3]:32221,[fd00:1122:3344:10b::3]:32221,[fd00:1122:3344:107::3]:32221,[fd00:1122:3344:108::3]:32221/omicron?sslmode=disable
WARN: found schema version 257.0.0, expected 261.0.0
It's possible the database is running a version that's different from what this
tool understands.  This may result in errors or incorrect output.
 SYSTEM_VERSION              TIME_REQUESTED
 20.0.0-0.ci+git8ca64d81e70  2026-05-15T19:02:14.696Z

omdb db target-release --all

root@oxz_switch0:/tmp# ./omdb-test db target-release --all
note: database URL not specified.  Will search DNS.
note: (override with --db-url or OMDB_DB_URL)
note: using DNS from system config (typically /etc/resolv.conf)
note: (if this is not right, use --dns-server to specify an alternate DNS server)
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221,[fd00:1122:3344:105::3]:32221,[fd00:1122:3344:10b::3]:32221,[fd00:1122:3344:107::3]:32221,[fd00:1122:3344:108::3]:32221/omicron?sslmode=disable
WARN: found schema version 257.0.0, expected 261.0.0
It's possible the database is running a version that's different from what this
tool understands.  This may result in errors or incorrect output.
 SYSTEM_VERSION              TIME_REQUESTED
 20.0.0-0.ci+git8ca64d81e70  2026-05-15T19:02:14.696Z
 19.4.0-0.ci+gitbae719a3bdb  2026-05-13T15:11:13.005Z
 19.3.0-0.ci+gitd4a126e8cc3  2026-05-05T23:45:46.284Z
 19.2.0-0.ci+gite4b75dde134  2026-04-21T23:11:22.248Z
 19.1.0-0.ci+gitc7312331b08  2026-04-14T21:02:48.258Z
 19.1.0-0.ci+gitbc696216ef5  2026-04-13T23:24:19.034Z
 19.1.0-0.ci+git073b1306678  2026-04-11T03:25:49.438Z
 19.0.0-0.ci+git42726ecbb1b  2026-04-08T00:25:34.431Z
 19.0.0-0.ci+gitefa6443bdeb  2026-04-07T22:17:32.562Z
 19.0.0-0.ci+git19d83513171  2026-04-05T04:32:40.595Z
 19.0.0-0.ci+gitd41bfa5af31  2026-04-03T04:54:04.617Z
 19.0.0-0.ci+git09c8c584ee4  2026-03-31T22:43:14.138Z
 19.0.0-0.ci+gite2fe4014825  2026-03-30T19:40:42.138Z
 19.0.0-0.ci+git10b9f2fb872  2026-03-17T20:03:56.652Z
 19.0.0-0.ci+git6409f6a4bd2  2026-03-12T22:15:37.278Z
 19.0.0-0.ci+git9dd23096de9  2026-03-06T17:53:51.816Z
 19.0.0-0.ci+git328ba48fdf8  2026-03-03T16:17:40.390Z
 19.0.0-0.ci+git1d6977056c6  2026-02-25T21:19:42.918Z
 19.0.0-0.ci+gitd3ef1db023b  2026-02-23T20:11:11.484Z
 18.1.0-0.ci+git550f05cd523  2026-02-19T22:01:07.520Z
 18.1.0-0.ci+git1003e128ad7  2026-02-19T03:50:33.288Z
 18.0.0-0.ci+gitd211c40e1e5  2026-02-19T03:44:48.239Z
 18.0.0-0.ci+git4a456c99797  2026-02-14T05:50:48.190Z
 18.0.0-0.ci+gitcfc181ba02d  2026-02-13T19:05:06.745Z
 18.0.0-0.ci+git56926cd1982  2026-02-12T20:57:17.714Z
 18.0.0-0.ci+git0ee7d730282  2026-02-11T17:36:22.522Z
 18.0.0-0.ci+gita728a7f63fa  2026-02-11T03:51:16.313Z
 18.0.0-0.ci+gitc643ed39da8  2026-02-10T13:49:51.601Z
 18.0.0-0.ci+git6d17d64ce6d  2026-02-09T23:15:31.775Z
 18.0.0-0.ci+git687f721a7c9  2026-02-09T21:52:51.151Z
 18.0.0-0.ci+git4b3cdb4e30b  2026-02-06T03:54:34.703Z
 18.0.0-0.ci+git360801b804e  2026-02-05T12:46:26.621Z
 18.0.0-0.ci+git52e04b3b26e  2026-02-03T11:39:03.606Z
 18.0.0-0.ci+git5292c0d21f9  2026-02-03T04:04:06.323Z
 18.0.0-0.ci+git17cf00dbf0a  2026-01-31T18:43:00.741Z
 18.0.0-0.ci+git1c0f2b3c24c  2026-01-28T21:11:01.168Z
 18.0.0-0.ci+git92e0ae0c98d  2026-01-27T04:58:08.255Z
 18.0.0-0.ci+git5eb13372380  2026-01-24T22:42:41.788Z
 18.0.0-0.ci+git5eb13372380  2026-01-24T18:34:49.860Z
 18.0.0-0.ci+git5eb13372380  2026-01-22T00:31:36.716Z
 18.0.0-0.ci+git4175bf66d6c  2026-01-18T22:36:09.037Z
 18.0.0-0.ci+gitf507a3057c7  2026-01-14T23:32:11.568Z
 18.0.0-0.ci+git8ae817f7284  2026-01-08T19:37:04.637Z
 18.0.0-0.ci+git3b3f937d05f  2026-01-01T00:52:08.783Z
 18.0.0-0.ci+gitc298def0b9f  2025-12-24T16:27:48.945Z
 18.0.0-0.ci+git99c3f3ef97f  2025-12-13T01:01:20.744Z
 18.0.0-0.ci+git474c1588c05  2025-12-12T20:50:16.012Z
 18.0.0-0.ci+git078382f5d9c  2025-12-08T23:28:55.326Z
 18.0.0-0.ci+git6601b8ec8a4  2025-12-02T01:55:46.374Z
 17.0.0-0.ci+git01bb8750d9c  2025-11-11T05:13:20.575Z
 17.0.0-0.ci+git27b3ef9b9d0  2025-11-07T00:30:58.541Z
 17.0.0-0.ci+gitf83a43dbb42  2025-11-05T23:19:16.749Z
 17.0.0-0.ci+gite980820e5b5  2025-11-04T23:19:00.573Z
 17.0.0-0.ci+git81d822614e1  2025-11-04T22:18:06.948Z
 17.0.0-0.ci+git495eab19cfc  2025-11-01T00:01:17.962Z
 17.0.0-0.ci+gitcf97c145a6e  2025-10-30T05:32:40.451Z
 17.0.0-0.ci+gitc5c0834b174  2025-10-30T00:45:03.409Z
 17.0.0-0.ci+git56225535f8e  2025-10-29T19:46:33.164Z
 17.0.0-0.ci+git6510e87da6a  2025-10-27T20:50:15.701Z
 17.0.0-0.ci+git7bc5275729c  2025-10-24T18:02:19.767Z
 17.0.0-0.ci+gitaf3b89ffce6  2025-10-23T06:09:22.810Z
 17.0.0-0.ci+git3a90a985264  2025-10-22T23:59:21.609Z
 17.0.0-0.ci+git2a1d8548932  2025-10-22T18:07:59.734Z
 17.0.0-0.ci+git34818139bb2  2025-10-21T22:40:59.317Z
 17.0.0-0.ci+git27a65080e1b  2025-10-19T00:32:07.040Z
 17.0.0-0.ci+gita3bf7ea02ce  2025-10-18T03:29:05.318Z
 17.0.0-0.ci+gitd17fb154c39  2025-10-17T16:06:06.951Z
 17.0.0-0.ci+git529ba64ee28  2025-10-10T21:20:54.455Z
 17.0.0-0.ci+git8c683c74af9  2025-10-10T16:10:29.091Z
 17.0.0-0.ci+git76ec1fa523c  2025-10-09T16:21:21.378Z
 17.0.0-0.ci+git063828b53e7  2025-10-09T16:07:34.772Z
 17.0.0-0.ci+gitb8efb9a08b3  2025-10-08T20:38:25.697Z
 17.0.0-0.ci+git178c3c1ae84  2025-10-08T20:00:04.115Z
 <unspecified>               2025-03-08T04:05:05.028Z

@emunn13
Copy link
Copy Markdown
Author

emunn13 commented May 22, 2026

Tested latest commit (dd347a4) on dogfood. Newest record at the bottom.

omdb db target-release --all

root@oxz_switch0:/tmp# ./omdb-em-test db target-release --all
note: database URL not specified.  Will search DNS.
note: (override with --db-url or OMDB_DB_URL)
note: using DNS from system config (typically /etc/resolv.conf)
note: (if this is not right, use --dns-server to specify an alternate DNS server)
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221,[fd00:1122:3344:105::3]:32221,[fd00:1122:3344:10b::3]:32221,[fd00:1122:3344:107::3]:32221,[fd00:1122:3344:108::3]:32221/omicron?sslmode=disable
WARN: found schema version 257.0.0, expected 261.0.0
It's possible the database is running a version that's different from what this
tool understands.  This may result in errors or incorrect output.
 SYSTEM_VERSION              TIME_REQUESTED
 <unspecified>               2025-03-08T04:05:05.028Z
 17.0.0-0.ci+git178c3c1ae84  2025-10-08T20:00:04.115Z
 17.0.0-0.ci+gitb8efb9a08b3  2025-10-08T20:38:25.697Z
 17.0.0-0.ci+git063828b53e7  2025-10-09T16:07:34.772Z
 17.0.0-0.ci+git76ec1fa523c  2025-10-09T16:21:21.378Z
 17.0.0-0.ci+git8c683c74af9  2025-10-10T16:10:29.091Z
 17.0.0-0.ci+git529ba64ee28  2025-10-10T21:20:54.455Z
 17.0.0-0.ci+gitd17fb154c39  2025-10-17T16:06:06.951Z
 17.0.0-0.ci+gita3bf7ea02ce  2025-10-18T03:29:05.318Z
 17.0.0-0.ci+git27a65080e1b  2025-10-19T00:32:07.040Z
 17.0.0-0.ci+git34818139bb2  2025-10-21T22:40:59.317Z
 17.0.0-0.ci+git2a1d8548932  2025-10-22T18:07:59.734Z
 17.0.0-0.ci+git3a90a985264  2025-10-22T23:59:21.609Z
 17.0.0-0.ci+gitaf3b89ffce6  2025-10-23T06:09:22.810Z
 17.0.0-0.ci+git7bc5275729c  2025-10-24T18:02:19.767Z
 17.0.0-0.ci+git6510e87da6a  2025-10-27T20:50:15.701Z
 17.0.0-0.ci+git56225535f8e  2025-10-29T19:46:33.164Z
 17.0.0-0.ci+gitc5c0834b174  2025-10-30T00:45:03.409Z
 17.0.0-0.ci+gitcf97c145a6e  2025-10-30T05:32:40.451Z
 17.0.0-0.ci+git495eab19cfc  2025-11-01T00:01:17.962Z
 17.0.0-0.ci+git81d822614e1  2025-11-04T22:18:06.948Z
 17.0.0-0.ci+gite980820e5b5  2025-11-04T23:19:00.573Z
 17.0.0-0.ci+gitf83a43dbb42  2025-11-05T23:19:16.749Z
 17.0.0-0.ci+git27b3ef9b9d0  2025-11-07T00:30:58.541Z
 17.0.0-0.ci+git01bb8750d9c  2025-11-11T05:13:20.575Z
 18.0.0-0.ci+git6601b8ec8a4  2025-12-02T01:55:46.374Z
 18.0.0-0.ci+git078382f5d9c  2025-12-08T23:28:55.326Z
 18.0.0-0.ci+git474c1588c05  2025-12-12T20:50:16.012Z
 18.0.0-0.ci+git99c3f3ef97f  2025-12-13T01:01:20.744Z
 18.0.0-0.ci+gitc298def0b9f  2025-12-24T16:27:48.945Z
 18.0.0-0.ci+git3b3f937d05f  2026-01-01T00:52:08.783Z
 18.0.0-0.ci+git8ae817f7284  2026-01-08T19:37:04.637Z
 18.0.0-0.ci+gitf507a3057c7  2026-01-14T23:32:11.568Z
 18.0.0-0.ci+git4175bf66d6c  2026-01-18T22:36:09.037Z
 18.0.0-0.ci+git5eb13372380  2026-01-22T00:31:36.716Z
 18.0.0-0.ci+git5eb13372380  2026-01-24T18:34:49.860Z
 18.0.0-0.ci+git5eb13372380  2026-01-24T22:42:41.788Z
 18.0.0-0.ci+git92e0ae0c98d  2026-01-27T04:58:08.255Z
 18.0.0-0.ci+git1c0f2b3c24c  2026-01-28T21:11:01.168Z
 18.0.0-0.ci+git17cf00dbf0a  2026-01-31T18:43:00.741Z
 18.0.0-0.ci+git5292c0d21f9  2026-02-03T04:04:06.323Z
 18.0.0-0.ci+git52e04b3b26e  2026-02-03T11:39:03.606Z
 18.0.0-0.ci+git360801b804e  2026-02-05T12:46:26.621Z
 18.0.0-0.ci+git4b3cdb4e30b  2026-02-06T03:54:34.703Z
 18.0.0-0.ci+git687f721a7c9  2026-02-09T21:52:51.151Z
 18.0.0-0.ci+git6d17d64ce6d  2026-02-09T23:15:31.775Z
 18.0.0-0.ci+gitc643ed39da8  2026-02-10T13:49:51.601Z
 18.0.0-0.ci+gita728a7f63fa  2026-02-11T03:51:16.313Z
 18.0.0-0.ci+git0ee7d730282  2026-02-11T17:36:22.522Z
 18.0.0-0.ci+git56926cd1982  2026-02-12T20:57:17.714Z
 18.0.0-0.ci+gitcfc181ba02d  2026-02-13T19:05:06.745Z
 18.0.0-0.ci+git4a456c99797  2026-02-14T05:50:48.190Z
 18.0.0-0.ci+gitd211c40e1e5  2026-02-19T03:44:48.239Z
 18.1.0-0.ci+git1003e128ad7  2026-02-19T03:50:33.288Z
 18.1.0-0.ci+git550f05cd523  2026-02-19T22:01:07.520Z
 19.0.0-0.ci+gitd3ef1db023b  2026-02-23T20:11:11.484Z
 19.0.0-0.ci+git1d6977056c6  2026-02-25T21:19:42.918Z
 19.0.0-0.ci+git328ba48fdf8  2026-03-03T16:17:40.390Z
 19.0.0-0.ci+git9dd23096de9  2026-03-06T17:53:51.816Z
 19.0.0-0.ci+git6409f6a4bd2  2026-03-12T22:15:37.278Z
 19.0.0-0.ci+git10b9f2fb872  2026-03-17T20:03:56.652Z
 19.0.0-0.ci+gite2fe4014825  2026-03-30T19:40:42.138Z
 19.0.0-0.ci+git09c8c584ee4  2026-03-31T22:43:14.138Z
 19.0.0-0.ci+gitd41bfa5af31  2026-04-03T04:54:04.617Z
 19.0.0-0.ci+git19d83513171  2026-04-05T04:32:40.595Z
 19.0.0-0.ci+gitefa6443bdeb  2026-04-07T22:17:32.562Z
 19.0.0-0.ci+git42726ecbb1b  2026-04-08T00:25:34.431Z
 19.1.0-0.ci+git073b1306678  2026-04-11T03:25:49.438Z
 19.1.0-0.ci+gitbc696216ef5  2026-04-13T23:24:19.034Z
 19.1.0-0.ci+gitc7312331b08  2026-04-14T21:02:48.258Z
 19.2.0-0.ci+gite4b75dde134  2026-04-21T23:11:22.248Z
 19.3.0-0.ci+gitd4a126e8cc3  2026-05-05T23:45:46.284Z
 19.4.0-0.ci+gitbae719a3bdb  2026-05-13T15:11:13.005Z
 20.0.0-0.ci+git8ca64d81e70  2026-05-15T19:02:14.696Z

omdb db target-release

root@oxz_switch0:/tmp# ./omdb-em-test db target-release
note: database URL not specified.  Will search DNS.
note: (override with --db-url or OMDB_DB_URL)
note: using DNS from system config (typically /etc/resolv.conf)
note: (if this is not right, use --dns-server to specify an alternate DNS server)
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221,[fd00:1122:3344:105::3]:32221,[fd00:1122:3344:10b::3]:32221,[fd00:1122:3344:107::3]:32221,[fd00:1122:3344:108::3]:32221/omicron?sslmode=disable
WARN: found schema version 257.0.0, expected 261.0.0
It's possible the database is running a version that's different from what this
tool understands.  This may result in errors or incorrect output.
 SYSTEM_VERSION              TIME_REQUESTED
 20.0.0-0.ci+git8ca64d81e70  2026-05-15T19:02:14.696Z

@emunn13 emunn13 marked this pull request as ready for review May 22, 2026 22:18
@emunn13 emunn13 requested review from jgallagher and karencfv May 22, 2026 22:18
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.

3 participants