Skip to content

Commit

Permalink
Fix startup failure (#75)
Browse files Browse the repository at this point in the history
* Correct 0.20.0 changelog entry
* prepare_dependencies_graph_repository(): add missed dependency
* build.yaml: remove commented code
* DI tests: check dependencies_graph_repository as well
* Release (patch): 0.20.1
  • Loading branch information
s373r authored Apr 17, 2024
1 parent 57daf5f commit 3ce0408
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 28 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ jobs:
cache-on-failure: true
- name: build
run: cargo test ${{ env.CARGO_FLAGS }} --no-run
# - name: pull test images
# run: cargo test ${{ env.CARGO_FLAGS }} test_setup_pull_images -- --nocapture
- name: run tests
run: cargo test ${{ env.CARGO_FLAGS }}
- name: check git diff
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.20.1] - 2024-04-17
### Fixed
- Fixed startup failure by missed DI dependency

## [0.20.0] - 2024-04-15
### Changed
- The `/ingest` REST API endpoint also supports event time hints via odf-event-time header
### Fixed
- Removed paused from setConfigCompacting mutation
- Extended GraphQL FlowDescriptionDatasetHardCompacting empty result with a resulting message
- Removed paused from `setConfigCompacting` mutation
- Extended GraphQL `FlowDescriptionDatasetHardCompacting` empty result with a resulting message
- GraphQL Dataset Endpoints object: fixed the query endpoint

## [0.19.0] - 2024-04-09
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kamu-adapter-flight-sql = { git = "https://github.com/kamu-data/kamu-cli", tag =


[workspace.package]
version = "0.20.0"
version = "0.20.1"
edition = "2021"
homepage = "https://github.com/kamu-data/kamu-platform"
repository = "https://github.com/kamu-data/kamu-platform"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Business Source License 1.1

Licensor: Kamu Data, Inc.

Licensed Work: Kamu Platform Version 0.20.0
Licensed Work: Kamu Platform Version 0.20.1
The Licensed Work is © 2023 Kamu Data, Inc.

Additional Use Grant: You may use the Licensed Work for any purpose,
Expand Down
9 changes: 5 additions & 4 deletions src/app/api-server/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::sync::Arc;

use dill::{CatalogBuilder, Component};
use internal_error::*;
use kamu::domain::{CurrentAccountSubject, ServerUrlConfig};
use kamu::domain::{CurrentAccountSubject, ServerUrlConfig, SystemTimeSourceDefault};
use opendatafabric::AccountName;
use tracing::info;
use url::Url;
Expand Down Expand Up @@ -230,15 +230,16 @@ pub async fn prepare_dependencies_graph_repository(

configure_repository(&mut b, repo_url, multi_tenant, &config.repo).await;

let special_catlaog = b
let special_catalog = b
.add::<SystemTimeSourceDefault>()
.add::<event_bus::EventBus>()
.add_value(current_account_subject)
.add::<kamu::domain::auth::AlwaysHappyDatasetActionAuthorizer>()
.add::<kamu::DependencyGraphServiceInMemory>()
// Don't add it's own initializer, leave optional dependency uninitialized
// Don't add its own initializer, leave optional dependency uninitialized
.build();

let dataset_repo = special_catlaog.get_one().unwrap();
let dataset_repo = special_catalog.get_one().unwrap();

kamu::DependencyGraphRepositoryInMemory::new(dataset_repo)
}
Expand Down
49 changes: 33 additions & 16 deletions src/app/api-server/tests/tests/test_di_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,35 @@
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

use dill::*;

#[test_log::test(tokio::test)]
async fn test_di_graph_validates_local() {
let tempdir = tempfile::tempdir().unwrap();
let mut catalog_builder = kamu_api_server::init_dependencies(
kamu_api_server::config::ApiServerConfig::default(),
&url::Url::from_directory_path(tempdir.path()).unwrap(),
false,
tempdir.path(),

let multi_tenant = false;
let config = kamu_api_server::config::ApiServerConfig::default();
let repo_url = url::Url::from_directory_path(tempdir.path()).unwrap();

let dependencies_graph_repository = kamu_api_server::prepare_dependencies_graph_repository(
kamu::domain::CurrentAccountSubject::new_test(),
&repo_url,
multi_tenant,
&config,
)
.await;

let mut catalog_builder =
kamu_api_server::init_dependencies(config, &repo_url, multi_tenant, tempdir.path()).await;

catalog_builder.add_value(dependencies_graph_repository);

// CurrentAccountSubject is inserted by middlewares, but won't be present in
// default dependency graph, so we have to add it manually
// the default dependency graph, so we have to add it manually
catalog_builder.add_value(kamu::domain::CurrentAccountSubject::new_test());

// TODO: We should ensure this test covers parameters requested by commands and
// types needed for GQL/HTTP adapter that are currently being constructed
// manually
let validate_result = catalog_builder
.validate()
.ignore::<dyn kamu::domain::DatasetRepository>();
let validate_result = catalog_builder.validate();

assert!(
validate_result.is_ok(),
Expand Down Expand Up @@ -59,24 +65,35 @@ async fn test_di_graph_validates_remote() {
))
.unwrap();

let multi_tenant = true;
let config = kamu_api_server::config::ApiServerConfig::default();

let dependencies_graph_repository = kamu_api_server::prepare_dependencies_graph_repository(
kamu::domain::CurrentAccountSubject::new_test(),
&repo_url,
multi_tenant,
&config,
)
.await;

let mut catalog_builder = kamu_api_server::init_dependencies(
kamu_api_server::config::ApiServerConfig::default(),
&repo_url,
true,
multi_tenant,
tmp_repo_dir.path(),
)
.await;

catalog_builder.add_value(dependencies_graph_repository);

// CurrentAccountSubject is inserted by middlewares, but won't be present in
// default dependency graph, so we have to add it manually
// the default dependency graph, so we have to add it manually
catalog_builder.add_value(kamu::domain::CurrentAccountSubject::new_test());

// TODO: We should ensure this test covers parameters requested by commands and
// types needed for GQL/HTTP adapter that are currently being constructed
// manually
let validate_result = catalog_builder
.validate()
.ignore::<dyn kamu::domain::DatasetRepository>();
let validate_result = catalog_builder.validate();

assert!(
validate_result.is_ok(),
Expand Down

0 comments on commit 3ce0408

Please sign in to comment.