Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6721dcb
Feat: add get all func for comments module
aragami3070 Jul 14, 2025
0232aad
Feat: add CommentCommand in CliCommand with get all
aragami3070 Jul 14, 2025
01bd36d
Feat: add print comments method for print in cli mod
aragami3070 Jul 14, 2025
63cc540
Feat: add handle comment get all
aragami3070 Jul 14, 2025
1e731c5
Feat: add rstest for tests with different cases
aragami3070 Jul 15, 2025
4426aab
Feat: add RepoOwner valid cases test
aragami3070 Jul 15, 2025
57701d1
Feat: add RepoOwner empty string test
aragami3070 Jul 15, 2025
b980ce8
Feat: change empty RepoOwner test to universal invalid_repo_owner tes…
aragami3070 Jul 15, 2025
3bde669
Feat: add RepoName tests
aragami3070 Jul 15, 2025
8a7f973
Feat: add paste! for RepoOwner and RepoName tests in macro rules
aragami3070 Jul 15, 2025
95c3f1c
Feat: add RepoOwner and RepoName tests in macro rule
aragami3070 Jul 15, 2025
bcd8975
Feat: add cargo test command in rust.yml
aragami3070 Jul 15, 2025
a6183b4
Chore: code formatting
aragami3070 Jul 15, 2025
9443dc8
Feat: add repo_links_field_valid_test macros for RepoUrl and RepoSsh
aragami3070 Jul 15, 2025
03f576b
Feat: add valid_new_repo_info test
aragami3070 Jul 15, 2025
8f96894
Feat: add invalid_new_input_repo_info
aragami3070 Jul 15, 2025
7fbc7a8
Feat: add get all from review in comments module
aragami3070 Jul 15, 2025
a01c3f6
Feat: add print review comments method for print in cli mod
aragami3070 Jul 15, 2025
8ddaaa2
Feat: add CommentTarget enum and impl FromStr
aragami3070 Jul 15, 2025
04b4ef2
Feat: add flag for select get comments from issue or pull request for…
aragami3070 Jul 15, 2025
9389ea4
Feat: add get and print review comments for target 'pull-request' in …
aragami3070 Jul 15, 2025
39b2de6
Chore: update print comments method
aragami3070 Jul 15, 2025
c93308c
Chore: update road map
aragami3070 Jul 15, 2025
ac6995c
Feat: update package version
aragami3070 Jul 15, 2025
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 .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ jobs:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
130 changes: 129 additions & 1 deletion 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
@@ -1,9 +1,11 @@
[package]
name = "github-cli"
version = "1.9.2"
version = "1.10.0"
edition = "2021"

[dependencies]
octorust = "0.10.0"
clap = { version = "4.5.39", features = ["derive"] }
tokio = { version = "1.45.1", features = ["full"] }
rstest = "0.25.0"
paste = "1.0.15"
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ github-cli release --help

### comment
- [x] Сделать создание комментария в issue/pull request
- [ ] Сделать получение комментариев для issue/pull request
- [x] Сделать получение комментариев для issue/pull request
- [ ] Сделать редактирование комментария для issue/pull request
- [ ] Сделать удаление комментария для issue/pull request

Expand Down
14 changes: 13 additions & 1 deletion src/cli_in/comment_command.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use clap::{Subcommand};
use clap::Subcommand;

use crate::cli_in::set_vars::CommentTarget;

#[derive(Subcommand)]
pub enum CommentCommand {
Expand All @@ -11,4 +13,14 @@ pub enum CommentCommand {
#[clap(long, short, default_value = "")]
body: String,
},

/// Get all comments from issue/pull request
GetAll {
/// Get all comments from issue/pull request with number
#[clap(long, short)]
number: i64,
/// Get from issue or from pull request (can be only 'issue' or 'pull-request')
#[clap(long, short)]
target: CommentTarget,
},
}
2 changes: 1 addition & 1 deletion src/cli_in/issue_command.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use clap::{Subcommand};
use clap::Subcommand;

use crate::cli_in::set_vars::{IssuesListStates, States};

Expand Down
8 changes: 4 additions & 4 deletions src/cli_in/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod read_cli;
pub mod set_vars;
pub mod issue_command;
pub mod comment_command;
pub mod repo_command;
pub mod issue_command;
pub mod read_cli;
pub mod release_command;
pub mod repo_command;
pub mod set_vars;
8 changes: 4 additions & 4 deletions src/cli_in/release_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ pub enum ReleaseCommand {
/// Repo name
#[clap(long, short)]
repo: RepoName,
/// Tag name
/// Tag name
#[clap(long)]
tag_name: String,
/// Target commit hash (only long variant of commit hash)
/// Target commit hash (only long variant of commit hash)
#[clap(long)]
target_commitish: String,
/// Release name
Expand All @@ -27,10 +27,10 @@ pub enum ReleaseCommand {
/// Name of discussion category (optional)
#[clap(long, default_value = "")]
discussion_category_name: String,
/// It's draft? (optional)
/// It's draft? (optional)
#[clap(long, default_value = None)]
draft: Option<bool>,
/// It's prerelease? (optional)
/// It's prerelease? (optional)
#[clap(long, default_value = None)]
prerelease: Option<bool>,
},
Expand Down
11 changes: 8 additions & 3 deletions src/cli_in/repo_command.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use clap::Subcommand;

use crate::{cli_in::set_vars::{Orders, ReposListOrgSorts, ReposListOrgTypes, ReposListUserTypes, Visibilities}, git_utils::repo_info::{RepoName, RepoOwner}};
use crate::{
cli_in::set_vars::{
Orders, ReposListOrgSorts, ReposListOrgTypes, ReposListUserTypes, Visibilities,
},
git_utils::repo_info::{RepoName, RepoOwner},
};

#[derive(Subcommand)]
pub enum RepoCommand {
Expand Down Expand Up @@ -137,7 +142,7 @@ pub enum RepoCommand {

/// Get all repos from user
GetAllFromUser {
/// Owner name
/// Owner name
#[clap(long)]
owner: String,
/// Order can be only 'asc' or 'desc' (optional)
Expand All @@ -151,7 +156,7 @@ pub enum RepoCommand {
#[clap(long, short, default_value = "all")]
type_value: ReposListUserTypes,
///// NOT WORKING NOW BECAUSE OCTORUST BREAK THIS
///// Can include:
///// Can include:
///// - owner: Repositories that are owned by the authenticated user.
///// - collaborator: Repositories that the user has been added to as a collaborator.
///// - organization_member: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on.
Expand Down
18 changes: 18 additions & 0 deletions src/cli_in/set_vars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,21 @@ impl ToString for IssuesListStates {
}
}
}

#[derive(Debug, Clone)]
pub enum CommentTarget {
Issue,
PullRequest,
}

impl FromStr for CommentTarget {
type Err = String;

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"issue" => Ok(CommentTarget::Issue),
"pull-request" => Ok(CommentTarget::PullRequest),
_ => Err("Bad input. Comment target can be only 'issue' or 'pull-request'".to_string()),
}
}
}
Loading