Fixing dependabot and its mistakes (#2232)

* updating to utoipa 4.0.0
* hi dependabot
This commit is contained in:
James Hodgkinson 2023-10-16 15:15:53 +10:00 committed by GitHub
parent 4757ed8a50
commit eead47aec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 225 additions and 57 deletions

170
.github/dependabot.yml vendored
View file

@ -8,6 +8,10 @@ updates:
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: pip
directory: "/pykanidm"
schedule:
@ -15,6 +19,10 @@ updates:
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/"
schedule:
@ -22,20 +30,32 @@ updates:
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/kanidm_client"
directory: "/libs/client"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/kanidm_proto"
directory: "/proto"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/server/core"
schedule:
@ -43,13 +63,65 @@ updates:
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/server/score"
directory: "/server/testkit"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/server/testkit-macros"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/libs/crypto"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/server/lib"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/server/lib-macros"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/server/daemon"
schedule:
@ -57,6 +129,10 @@ updates:
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/tools/cli"
schedule:
@ -64,6 +140,10 @@ updates:
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/server/web_ui"
schedule:
@ -71,47 +151,115 @@ updates:
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/kanidm_unix_int"
directory: "/unix_integration"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
- package-ecosystem: cargo
directory: "/kanidm_unix_int/nss_kanidm"
directory: "/unix_integration/nss_kanidm"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/kanidm_unix_int/pam_kanidm"
directory: "/unix_integration/pam_kanidm"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/kanidm_unix_int/pam_tester"
directory: "/tools/orca"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/orca"
directory: "/libs/file_permissions"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/profiles"
directory: "/libs/profiles"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/libs/sketching"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/libs/user"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/tools/iam_migrations/ldap"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
- package-ecosystem: cargo
directory: "/tools/iam_migrations/freeipa"
schedule:
interval: weekly
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
@ -120,3 +268,7 @@ updates:
time: "06:00"
timezone: Australia/Brisbane
open-pull-requests-limit: 99
groups:
all: # group all the things
patterns:
- "*"

View file

@ -17,6 +17,11 @@ concurrency:
jobs:
rust_build:
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust
@ -38,10 +43,21 @@ jobs:
run: cargo build --workspace
- name: "Build the idv-tui feature kanidm binary"
run: cargo build --bin kanidm --features idv-tui
- name: "Check disk space and size of target, then clean it"
run: |
df -h
du -sh target/
rm -rf target/*
- name: "Run cargo test"
run: cargo test
run_release:
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust

34
Cargo.lock generated
View file

@ -2952,7 +2952,7 @@ dependencies = [
"tracing",
"url",
"urlencoding",
"utoipa 3.5.0",
"utoipa",
"uuid",
"webauthn-rs-proto",
]
@ -3082,7 +3082,7 @@ dependencies = [
"tracing-subscriber",
"url",
"urlencoding",
"utoipa 3.5.0",
"utoipa",
"utoipa-swagger-ui",
"uuid",
"walkdir",
@ -5712,18 +5712,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]]
name = "utoipa"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d82b1bc5417102a73e8464c686eef947bdfb99fcdfc0a4f228e81afa9526470a"
dependencies = [
"indexmap 2.0.2",
"serde",
"serde_json",
"utoipa-gen 3.5.0",
]
[[package]]
name = "utoipa"
version = "4.0.0"
@ -5733,20 +5721,7 @@ dependencies = [
"indexmap 2.0.2",
"serde",
"serde_json",
"utoipa-gen 4.0.0",
]
[[package]]
name = "utoipa-gen"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d96dcd6fc96f3df9b3280ef480770af1b7c5d14bc55192baa9b067976d920c"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"regex",
"syn 2.0.38",
"utoipa-gen",
]
[[package]]
@ -5758,6 +5733,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"regex",
"syn 2.0.38",
]
@ -5773,7 +5749,7 @@ dependencies = [
"rust-embed",
"serde",
"serde_json",
"utoipa 4.0.0",
"utoipa",
"zip",
]

View file

@ -207,7 +207,8 @@ tss-esapi = "^7.4.0"
url = "^2.4.1"
urlencoding = "2.1.3"
users = "^0.11.0"
utoipa = "3.5.0"
utoipa = "4.0.0"
utoipa-swagger-ui = "4.0.0"
uuid = "^1.4.1"
wasm-bindgen = "^0.2.86"

View file

@ -7,20 +7,27 @@ fi
PR_URL="$1"
# are we good?
CONCLUSIONS="$(gh pr status --json statusCheckRollup | jq '.currentBranch | .[] | .[] | select(.conclusion != "SUCCESS") | select(.conclusion != "NEUTRAL")| {status: .status, workfFlowName: .workFlowName, conclusion: .conclusion}')"
# check approval
APPROVED="$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)"
# sets the upstream metadata for `gh pr status`
gh pr checkout "$PR_URL"
if [ "${APPROVED}" != "APPROVED" ]; then
echo "PR not approved!"
exit 1
fi
# are we good?
echo "Checking Conclusions"
CONCLUSIONS="$(gh pr status --json statusCheckRollup | jq '.currentBranch | .[] | .[] | select(.conclusion != "SUCCESS") | select(.conclusion != "NEUTRAL")| {status: .status, workfFlowName: .workFlowName, conclusion: .conclusion}')"
if [ "$(echo "${CONCLUSIONS}" | wc -l)" -eq 0 ]; then
gh pr review --approve "$PR_URL"
else
echo "Already running or failed: ${CONCLUSIONS}";
fi
if [ "${APPROVED}" != "APPROVED" ]; then
echo "PR isn't approved!"
exit 0
fi
# check approval
echo "Checking if already approved...."
APPROVED="$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)"

View file

@ -67,7 +67,7 @@ utoipa = { workspace = true, features = [
"openapi_extensions",
"preserve_order", # Preserve order of properties when serializing the schema for a component.
] }
utoipa-swagger-ui = { version = "4.0.0", features = ["axum"] }
utoipa-swagger-ui = { workspace = true, features = ["axum"] }
[dev-dependencies]
walkdir = { workspace = true }

View file

@ -240,10 +240,5 @@ pub(crate) fn router() -> Router<ServerState> {
Router::new()
.route("/docs", get(Redirect::temporary("/docs/swagger-ui")))
.route("/docs/", get(Redirect::temporary("/docs/swagger-ui")))
.merge(
SwaggerUi::new("/docs/swagger-ui").url(
"/docs/v1/openapi.json",
<ApiDoc as utoipa::OpenApi>::openapi(),
)
)
.merge(SwaggerUi::new("/docs/swagger-ui").url("/docs/v1/openapi.json", ApiDoc::openapi()))
}

View file

@ -0,0 +1,21 @@
use serde::{Deserialize, Serialize};
use tracing::info;
#[kanidmd_testkit::test]
async fn check_that_the_swagger_api_loads(rsclient: kanidm_client::KanidmClient) {
#[derive(Serialize, Deserialize, Debug)]
struct OpenAPIResponse {
pub openapi: String,
}
rsclient.set_token("".into()).await;
info!("Running test: check_that_the_swagger_api_loads");
let url = rsclient.make_url("/docs/v1/openapi.json");
let foo: OpenAPIResponse = reqwest::get(url)
.await
.expect("Failed to get openapi.json")
.json()
.await
.unwrap();
assert!(foo.openapi != "1.2.3");
}