Skip to content

Commit b7da921

Browse files
authored
api_versions! should make public Semver consts (#8322)
they were private, so it was impossible to use version constants defined in a separate API crate. this is the relationship between the DNS server and DNS API types, as one example, so move that explicit `Semver` declaration to one from the `dns-server-api` crate.
1 parent 5b91b1d commit b7da921

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/openapi-manager/types/src/versions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ impl SupportedVersions {
106106
/// these, equivalent to:
107107
///
108108
/// ```
109-
/// const VERSION_ADD_FOOBAR_OPERATION: semver::Version =
109+
/// pub const VERSION_ADD_FOOBAR_OPERATION: semver::Version =
110110
/// semver::Version::new(2, 0, 0);
111-
/// const VERSION_INITIAL: semver::Version =
111+
/// pub const VERSION_INITIAL: semver::Version =
112112
/// semver::Version::new(1, 0, 0);
113113
/// ```
114114
///
@@ -147,7 +147,7 @@ macro_rules! api_versions {
147147
) ),* $(,)? ] ) => {
148148
openapi_manager_types::paste! {
149149
$(
150-
const [<VERSION_ $name>]: semver::Version =
150+
pub const [<VERSION_ $name>]: semver::Version =
151151
semver::Version::new($major, 0, 0);
152152
)*
153153

@@ -178,7 +178,7 @@ macro_rules! api_versions_picky {
178178
) ),* $(,)? ] ) => {
179179
openapi_manager_types::paste! {
180180
$(
181-
const [<VERSION_ $name>]: semver::Version =
181+
pub const [<VERSION_ $name>]: semver::Version =
182182
semver::Version::new($major, $minor, $patch);
183183
)*
184184

dns-server/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub async fn start_servers(
100100
"api-version"
101101
.parse::<http::header::HeaderName>()
102102
.expect("api-version is a valid header name"),
103-
semver::Version::new(2, 0, 0),
103+
dns_server_api::VERSION_SOA_AND_NS,
104104
),
105105
)))
106106
.start()

internal-dns/resolver/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ anyhow.workspace = true
2525
assert_matches.workspace = true
2626
dropshot.workspace = true
2727
dns-server.workspace = true
28+
dns-server-api.workspace = true
2829
dns-service-client.workspace = true
2930
expectorate.workspace = true
3031
omicron-test-utils.workspace = true

internal-dns/resolver/src/resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ mod test {
878878
"api-version"
879879
.parse::<reqwest::header::HeaderName>()
880880
.expect("api-version is a valid header name"),
881-
semver::Version::new(2, 0, 0),
881+
dns_server_api::VERSION_SOA_AND_NS,
882882
),
883883
)))
884884
.start()

0 commit comments

Comments
 (0)