Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dfx-orbit): dfx-orbitv0.3 #318

Merged
merged 46 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1216364
Fix test issue
Sawchord Jul 31, 2024
d6ee0b4
Update dependencies
Sawchord Aug 2, 2024
6dbd40e
Move logger up a layer
Sawchord Aug 2, 2024
52b9415
WIP refactoring asset upload into multiple smaller methods
Sawchord Aug 2, 2024
9926c6b
WIP factoring out asset functionality into it's own methods
Sawchord Aug 2, 2024
2c9629d
WIP refactoring asset upload
Sawchord Aug 2, 2024
8eb7f74
Remove unused mut
Sawchord Aug 2, 2024
8a953af
Implement check evidence method
Sawchord Aug 2, 2024
84ea59e
Implement request_commit_batch method
Sawchord Aug 2, 2024
c1710c7
WIP improve UX around asset
Sawchord Aug 2, 2024
c2a7737
WIP improving UX around assets
Sawchord Aug 2, 2024
0d54940
WIP UX in assets improvements
Sawchord Aug 5, 2024
ea13a3d
WIP implement asset check
Sawchord Aug 5, 2024
1df44ee
Test asset check
Sawchord Aug 5, 2024
552da41
Update README
Sawchord Aug 5, 2024
fcd6211
Update version and readme
Sawchord Aug 5, 2024
929d4af
Update approval UX
Sawchord Aug 5, 2024
32a8423
Implement a request_prepare_permission method
Sawchord Aug 5, 2024
cbf9848
Functionality to request prepare permission
Sawchord Aug 5, 2024
977d4dc
WIP Implement lookup for sources
Sawchord Aug 6, 2024
834c07c
Test the new functionality
Sawchord Aug 6, 2024
a75ab04
Merge branch 'main' into leon/dfx-orbitv0.2
Sawchord Aug 6, 2024
4d5259d
Settable verbosity levels
Sawchord Aug 7, 2024
25c5e87
Merge branch 'main' into leon/dfx-orbitv0.3
Sawchord Aug 8, 2024
9a3cea2
Settable --station
Sawchord Aug 8, 2024
301f362
WIP improve review UX
Sawchord Aug 9, 2024
acb49eb
Some renaming
Sawchord Aug 9, 2024
8b1aef0
WIP implement display for review list
Sawchord Aug 9, 2024
ff10355
Small improvements to the list arg parsing
Sawchord Aug 13, 2024
f5f0322
Improve review list output
Sawchord Aug 13, 2024
6dce4a2
Updating TODOs
Sawchord Aug 13, 2024
ed5eaff
Bump version
Sawchord Aug 13, 2024
4525d06
Update TODOs, remove unused code
Sawchord Aug 14, 2024
f6fe738
Refactor candid loading
Sawchord Aug 14, 2024
e9c3789
Clippy
Sawchord Aug 14, 2024
40b7471
Add canister lookup functionality
Sawchord Aug 14, 2024
d35f441
Better display functionality
Sawchord Aug 14, 2024
589b288
Implement detailed view for change canister
Sawchord Aug 14, 2024
09dae7e
Filter by external canister by default
Sawchord Aug 15, 2024
3bf0ab9
WIP display for call canister
Sawchord Aug 15, 2024
18e49fd
Display call external cansiter w/o types
Sawchord Aug 15, 2024
58d3199
More UX improvements for the CanisterCall functionality
Sawchord Aug 15, 2024
bbbaf83
Refactor
Sawchord Aug 15, 2024
878310f
Small refactors
Sawchord Aug 15, 2024
068fe55
Merge branch 'main' into leon/dfx-orbitv0.3
Sawchord Aug 16, 2024
3a15476
Merge branch 'main' into leon/dfx-orbitv0.3
Sawchord Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 145 additions & 2 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ candid = "0.10.3"
candid_parser = "0.1.3"
cap-std = "3.1.0"
clap = { version = "4.5.7", features = ["derive"] }
flate2 = "1.0"
dateparser = "0.2"
dfx-core = { git = "https://github.com/dfinity/sdk.git", tag = "0.22.0" }
flate2 = "1.0"
convert_case = "0.6"
futures = "0.3"
getrandom = { version = "0.2", features = ["custom"] }
Expand Down Expand Up @@ -81,6 +82,7 @@ slog-term = "2.9.0"
strum = "0.26"
strum_macros = "0.26"
syn = { version = "2.0", features = ["extra-traits", "full"] }
tabled = "0.16"
tempfile = "3.10"
thiserror = "1.0.48"
time = { version = "0.3", features = ["formatting", "parsing"] }
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ rand_chacha = { workspace = true }
reqwest = { workspace = true }
sha2 = { workspace = true }
serde = { workspace = true, features = ['derive'] }
slog = { workspace = true }
slog-async = { workspace = true }
slog-term = { workspace = true }
tempfile = { workspace = true }
tokio.workspace = true
uuid = { workspace = true }
Expand Down
27 changes: 17 additions & 10 deletions tests/integration/src/dfx_orbit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,26 @@ fn test_dfx_json_from_template(config: DfxOrbitTestConfig, port: u16) -> String

/// Setup the station agent for the test
async fn setup_dfx_orbit(station_id: Principal) -> DfxOrbit {
// Setup a logger with highest log level. Capture logging by test harness
use slog::Drain;
let decorator = slog_term::PlainDecorator::new(slog_term::TestStdoutWriter);
let drain = slog_term::FullFormat::new(decorator)
.build()
.filter_level(slog::Level::Trace)
.fuse();
let drain = slog_async::Async::new(drain).build().fuse();
let logger = slog::Logger::root(drain, slog::o!());

let port = PORT.with(|port| *port.borrow());

let orbit_agent = OrbitExtensionAgent::new().unwrap();
orbit_agent
.add_station(StationConfig {
name: String::from("Test"),
station_id,
network: String::from("test"),
url: format!("http://localhost:{}", port),
})
.unwrap();

DfxOrbit::new(orbit_agent).await.unwrap()
let config = StationConfig {
name: String::from("Test"),
station_id,
network: String::from("test"),
url: format!("http://localhost:{}", port),
};
DfxOrbit::new(orbit_agent, config, logger).await.unwrap()
}

/// Create the dfx user's identities and add them to the station
Expand Down
3 changes: 3 additions & 0 deletions tools/dfx-orbit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ serde.workspace = true
serde_bytes.workspace = true
serde_json.workspace = true
cap-std.workspace = true
dateparser.workspace = true
dfx-core.workspace = true
hex.workspace = true
ic-agent.workspace = true
ic-asset.workspace = true
ic-certified-assets.workspace = true
ic-utils.workspace = true
itertools.workspace = true
sha2.workspace = true
slog.workspace = true
slog-term.workspace = true
slog-async.workspace = true
tabled.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ['rt'] }
station-api = { path = '../../core/station/api', version = '0.0.2-alpha.5' }
Expand Down
25 changes: 17 additions & 8 deletions tools/dfx-orbit/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,37 @@ use review::ReviewArgs;
use station::StationArgs;

/// Manages Orbit on the Internet Computer.
// TODO: Specify --station to not use the default station
// TODO: Better version information
// TODO: -v flag
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
#[clap(version, about, long_about = None)]
pub struct DfxOrbitArgs {
/// Increase verbosity level
#[clap(short, long, action = clap::ArgAction::Count, conflicts_with = "quiet")]
pub(crate) verbose: u8,

/// Reduce verbosity level
#[clap(short, long, action = clap::ArgAction::Count, conflicts_with = "verbose")]
pub(crate) quiet: u8,

/// Name of the station to execute the command on. (Uses default station if unspecified)
#[clap(short, long)]
pub(crate) station: Option<String>,

/// Manage Orbit stations.
#[command(subcommand)]
pub command: DfxOrbitSubcommands,
#[clap(subcommand)]
pub(crate) command: DfxOrbitSubcommands,
}

/// CLI commands for managing Orbit on the Internet Computer.
#[derive(Debug, Subcommand)]
#[command(version, about, long_about = None)]
#[clap(version, about, long_about = None)]
pub enum DfxOrbitSubcommands {
/// Manage Orbit stations.
#[command(subcommand)]
#[clap(subcommand)]
Station(StationArgs),
/// Make requests to Orbit
Request(RequestArgs),
/// View and decide on requests.
#[command(subcommand)]
Review(ReviewArgs),
/// Manage assets stored in an asset canister through Orbit
Asset(AssetArgs),
Expand Down
6 changes: 3 additions & 3 deletions tools/dfx-orbit/src/args/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use clap::{Parser, Subcommand};

/// Station management commands.
#[derive(Debug, Clone, Parser)]
#[command(version, about, long_about = None)]
#[clap(version, about, long_about = None)]
pub struct AssetArgs {
#[command(subcommand)]
#[clap(subcommand)]
pub(crate) action: AssetArgsAction,
}

Expand Down Expand Up @@ -79,6 +79,6 @@ pub struct AssetCheckArgs {
pub(crate) files: Vec<String>,

/// Automatically approve the request, if the request's evidence matches the local evidence
#[clap(long)]
#[clap(short = 'a', long)]
pub(crate) then_approve: bool,
}
Loading
Loading