Skip to content

Commit

Permalink
bug: fix incorrect versions in schemas (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementTsang authored Nov 29, 2024
1 parent ae0d350 commit bc3032c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 32 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ jobs:
RUST_BACKTRACE: full

# Try running cargo build on all other platforms.
#
# TODO: Maybe some of these should be allowed to fail? If so, I guess we can add back the "unofficial" MSRV,
# I would also put android there.
other-check:
Expand Down Expand Up @@ -231,9 +232,6 @@ jobs:
no-clippy: true,
}

# Seems like cross' FreeBSD image is a bit broken? I
# get build errors, may be related to this issue:
# https://github.com/cross-rs/cross/issues/1291
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -252,24 +250,6 @@ jobs:
key: ${{ matrix.info.target }}
cache-all-crates: true

# - name: Test (default features)
# uses: ClementTsang/[email protected]
# if: ${{ matrix.info.no-default-features != true }}
# with:
# command: test
# args: --all-targets --workspace --target=${{ matrix.info.target }} --locked
# use-cross: ${{ matrix.info.cross }}
# cross-version: ${{ matrix.info.cross-version || '0.2.5' }}

# - name: Test (no features enabled)
# uses: ClementTsang/[email protected]
# if: ${{ matrix.info.no-default-features == true }}
# with:
# command: test
# args: --all-targets --workspace --target=${{ matrix.info.target }} --locked --no-default-features
# use-cross: ${{ matrix.info.cross }}
# cross-version: ${{ matrix.info.cross-version || '0.2.5' }}

- name: Check (default features)
uses: ClementTsang/[email protected]
if: ${{ matrix.info.no-default-features != true }}
Expand Down Expand Up @@ -298,6 +278,11 @@ jobs:
fail-fast: false
matrix:
info:
# Seems like cross' FreeBSD image is a bit broken? I
# get build errors, may be related to this issue:
# https://github.com/cross-rs/cross/issues/1291
#
# Alas, that's why we do it with VMs.
- {
type: "freebsd",
os_release: "14.1",
Expand Down
2 changes: 1 addition & 1 deletion schema/nightly/bottom.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/nightly/bottom.json",
"title": "Schema for bottom's configs (nightly)",
"title": "Schema for bottom's config file (nightly)",
"description": "https://clementtsang.github.io/bottom/nightly/configuration/config-file",
"type": "object",
"properties": {
Expand Down
6 changes: 3 additions & 3 deletions schema/v0.10/bottom.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/nightly/bottom.json",
"title": "Schema for bottom's configs (nightly)",
"description": "https://clementtsang.github.io/bottom/nightly/configuration/config-file",
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/v0.10/bottom.json",
"title": "Schema for bottom's configs (v0.10)",
"description": "https://clementtsang.github.io/bottom/0.10.0/configuration/config-file/",
"type": "object",
"properties": {
"cpu": {
Expand Down
4 changes: 2 additions & 2 deletions schema/v0.9/bottom.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/v1.0/bottom.json",
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/v0.9/bottom.json",
"$comment": "https://clementtsang.github.io/bottom/0.9.6/configuration/config-file/default-config/",
"title": "Schema for bottom's configs (v1.0)",
"title": "Schema for bottom's configs (v0.9)",
"type": "object",
"definitions": {
"row": {
Expand Down
1 change: 1 addition & 0 deletions src/bin/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ fn generate_schema(schema_options: SchemaOptions) -> anyhow::Result<()> {
"stable"
}
));
metadata.title = Some(format!("Schema for bottom's config file ({version})",));
println!("{}", serde_json::to_string_pretty(&schema).unwrap());

Ok(())
Expand Down
6 changes: 1 addition & 5 deletions src/options/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ use self::{cpu::CpuConfig, layout::Row, process::ProcessesConfig};

/// Overall config for `bottom`.
#[derive(Clone, Debug, Default, Deserialize)]
#[cfg_attr(
feature = "generate_schema",
derive(schemars::JsonSchema),
schemars(title = "Schema for bottom's configs (nightly)")
)]
#[cfg_attr(feature = "generate_schema", derive(schemars::JsonSchema))]
#[cfg_attr(test, serde(deny_unknown_fields), derive(PartialEq, Eq))]
pub struct Config {
pub(crate) flags: Option<FlagConfig>,
Expand Down

0 comments on commit bc3032c

Please sign in to comment.