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

remove pagination from integrations endpoint #275

Merged
merged 5 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ The format of this file is based on [Keep a Changelog](https://keepachangelog.co
## [Unreleased]

### Added

- Add `integrations list` command (#267)
- Add `front-matter-collection get` command (#271)
- Add `front-matter-collection set` command (#271)
- Add `front-matter-collection create` command (#271)
- Add `notebook front-matter append` command (#271)
- Add `notebook front-matter edit` command (#271)
- Add `notebook front-matter delete` command (#271)
- Removed pagination from the `integrations list` command (#171)

### Deprecated

Expand Down
37 changes: 15 additions & 22 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 @@ -86,6 +86,6 @@ vergen = { version = "8.0.0", features = [
] }

[patch.crates-io]
#fiberplane = { git = "ssh://[email protected]/fiberplane/fiberplane.git", branch = "main" }
fiberplane = { git = "ssh://[email protected]/fiberplane/fiberplane.git", branch = "main" }
#fp-bindgen-support = { git = "ssh://[email protected]/fiberplane/fp-bindgen.git", branch = "release-3.0.0" }
#fp-bindgen-macros = { git = "ssh://[email protected]/fiberplane/fp-bindgen.git", branch = "release-3.0.0" }
1 change: 1 addition & 0 deletions src/experiments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub struct Arguments {
}

#[derive(Parser)]
#[allow(clippy::manual_non_exhaustive)]
enum SubCommand {
/// Append a message to the given notebook
Message(MessageArgs),
Expand Down
20 changes: 9 additions & 11 deletions src/integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ pub async fn handle_command(args: Arguments) -> Result<()> {

#[derive(Parser)]
struct ListArgs {
/// Page to display
#[clap(long)]
page: Option<i32>,

/// Amount of integrations to display per page
#[clap(long)]
limit: Option<i32>,

/// Output of the webhooks
#[clap(long, short, default_value = "table", value_enum)]
output: IntegrationOutput,
Expand All @@ -62,7 +54,7 @@ enum IntegrationOutput {

async fn handle_integrations_list(args: ListArgs) -> Result<()> {
let client = api_client_configuration(args.token, args.config, args.base_url).await?;
let integrations = integrations_get(&client, args.page, args.limit).await?;
let integrations = integrations_get(&client).await?;

match args.output {
IntegrationOutput::Table => {
Expand Down Expand Up @@ -93,8 +85,14 @@ impl From<IntegrationSummary> for IntegrationRow {
Self {
id: integration.id.to_string(),
status: integration.status.to_string(),
created_at: integration.created_at.format(&Rfc3339).unwrap_or_default(),
updated_at: integration.updated_at.format(&Rfc3339).unwrap_or_default(),
created_at: integration.created_at.map_or_else(
|| "n/a".to_string(),
|time| time.format(&Rfc3339).unwrap_or_default(),
),
updated_at: integration.updated_at.map_or_else(
|| "n/a".to_string(),
|time| time.format(&Rfc3339).unwrap_or_default(),
),
}
}
}
Loading