Conversation
danbi2990
left a comment
There was a problem hiding this comment.
Changelog needs to be updated.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #130 +/- ##
==========================================
+ Coverage 28.42% 30.13% +1.71%
==========================================
Files 10 10
Lines 387 365 -22
==========================================
Hits 110 110
+ Misses 277 255 -22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The changelog needs to be updated to reflect the CLI and config changes. |
CHANGELOG.md
Outdated
| nor `last` is specified. | ||
| - GraphQL API `issues` and `pullRequests` return an error if conflicting | ||
| pagination arguments (e.g., `first` and `before`) are provided simultaneously. | ||
| - Changed from file-based configuration loading to Config-based loading, |
There was a problem hiding this comment.
I don't think "Config-based" clearly conveys what we intended, since it doesn't specify that "Config" refers to the crate. It would be better to use a more explicit form, such as the config crate, or the config crate, or config-based.
There was a problem hiding this comment.
Its official site refers to it as config, not Config.
There was a problem hiding this comment.
In addition to Kone's comment, I believe the following three key changes should be included (with better wording):
- Added CLI arguments:
--key,--cert - Changed CLI format:
-c <CONFIG_PATH> - Removed configuration file options for key and cert
There was a problem hiding this comment.
Based on your feedback, I removed the phrases "Config-based" and "resulting in changes to the CLI execution method," and provided a more detailed description of the CLI changes. Please let me know if any further revisions are needed; otherwise, I’ll proceed with this version. Thank you!
- Replaced file-based config loading with the `config` crate.
- Config file must now be specified with `-c <CONFIG_PATH>`
- `--key` and `--cert` are now required as CLI options instead of being set in the config file
|
The title now says |
src/settings.rs
Outdated
| } | ||
|
|
||
| impl Database { | ||
| pub(crate) fn get_path(&self) -> &Path { |
There was a problem hiding this comment.
I'm not sure this method is necessary.
If it is, the method name should be something other than get_path, in accordance with our naming guidelines. You can find details in Notion by searching for "get".
There was a problem hiding this comment.
Thank you. I removed this function.
src/settings.rs
Outdated
| pub(crate) key: PathBuf, | ||
| } | ||
|
|
||
| #[derive(Clone, Debug, Serialize, Deserialize)] |
There was a problem hiding this comment.
All Clone traits in this file are unnecessary.
src/settings.rs
Outdated
| let config_path_str = config_path | ||
| .to_str() | ||
| .ok_or_else(|| ConfigError::Message("Invalid config path".into()))?; | ||
|
|
||
| let settings = default_config_builder() | ||
| .add_source(File::with_name(config_path_str)) |
There was a problem hiding this comment.
#130 (comment)
As I suggested, the conversion from &Path to &str is unnecessary if we use File::from method.
There was a problem hiding this comment.
I'm sorry for overlooking that. Thank you for your meticulous code review.
| { | ||
| let addr = String::deserialize(deserializer)?; | ||
| addr.parse() | ||
| .map_err(|e| D::Error::custom(format!("invalid address \"{addr}\": {e}"))) |
There was a problem hiding this comment.
Let's maintain consistency in error messages by capitalizing the first letter.
f626cd5 to
8d59ec8
Compare
src/settings.rs
Outdated
| pub(crate) address: SocketAddr, | ||
| } | ||
|
|
||
| #[derive(Clone, Debug, Serialize, Deserialize)] |
There was a problem hiding this comment.
Clone trait seems unnecessary.
|
How about making commit message a bit more meaningful? |
src/settings.rs
Outdated
| config::Config::builder() | ||
| .set_default("address", DEFAULT_ADDR) | ||
| .expect("valid default address") | ||
| .set_default("database", DEFAULT_DATABASE_NAME) |
There was a problem hiding this comment.
The default value for the database does not work. It should be set using "database.db_path".
README.md
Outdated
| @@ -30,8 +28,6 @@ db_path = "db_path" | |||
| ``` | |||
|
|
|||
| - `address`: The address of web server. | |||
There was a problem hiding this comment.
Maybe we could add a bit more detail about what the default value is and how it works?
The same applies to db_path.
2480f37 to
c5503a1
Compare
| - To provide an SSH passphrase, set the `SSH_PASSPHRASE` environment variable. | ||
| - `db_path`: The path to the database for creation/connection. | ||
| - `db_path`: Folder where the sled database files are stored. Created | ||
| automatically if it doesn’t exist. (Default: github-dashboard) |
There was a problem hiding this comment.
I believe the default value for db_path should be absolute path - or it might be better not to provide a default at all.
It's not a big issue in debug builds since we typically run the program from the project root. However, in release builds, the working directory is not guaranteed, which can lead to the database being created in arbitrary locations.
There was a problem hiding this comment.
I believe the default value for
db_pathshould be absolute path - or it might be better not to provide a default at all.
@danbi2990, could you explain why db_path needs to be an absolute path?
Our software—like any other—should work with both absolute and relative paths. Software generally does not assume that a path is always absolute.
There was a problem hiding this comment.
I'm not saying that db_path must be an absolute path in all cases, but I believe the default value for db_path should be an absolute path.
The reason is to ensure a consistent and predictable database location. If the default is relative to the working directory, a new database might be created in different locations depending on where the program is run. I'd appreciate your thoughts on this.
There was a problem hiding this comment.
I still disagree with the idea that default paths should be absolute.
Of course, using absolute paths is preferable during deployment to avoid unexpected outcomes. However, when software suggests default path values, they are typically not absolute. Using absolute paths belongs to the domain of deployment and operations—not the software codebase itself.
For that reason, general documentation such as README.md tends to use relative paths as defaults, unless the path has a specific or special meaning. This also aligns with the decoupling principle: the software should not assume or be tightly bound to specific environments or file system layouts.
There was a problem hiding this comment.
Okay, I see your point. Let's keep it as a relative path. Thank you.
|
@danbi2990 |
|
@sophie-cluml Could you also review this PR? |
README.md
Outdated
| - `address`: The address of web server. | ||
| - `key`: The TLS key path for the web server. | ||
| - `cert`: The TLS certificate path for the web server. | ||
| - `address`: IP address and port the web server listens on. (Default: 127.0.0.1:8000) |
There was a problem hiding this comment.
마크다운파일에 대한 VS code 포매팅 세팅이 최신이 아닌 것 같습니다. 확인 부탁드립니다.
| use tracing::{error, info}; | ||
|
|
||
| use crate::conf::RepoInfo; | ||
| use crate::settings::Repository as RepoInfo; |
There was a problem hiding this comment.
굳이 alias로 use 할 이유가 없는 상황 같아서 alias 없애면 어떨까요?
There was a problem hiding this comment.
If I remove the alias, a conflict will occur between git2::{Cred, FetchOptions, RemoteCallbacks, Repository} and crate::settings::Repository.
There was a problem hiding this comment.
Thank you for clarification, certainly I overlooked that conflict.
src/settings.rs
Outdated
| } | ||
| } | ||
|
|
||
| /// Creates a new `ConfigBuilder` instance with the default configuration. |
There was a problem hiding this comment.
/// 는 rustdoc comment 이므로, private function에는 사실상 ineffective한 효과를 발생시킬 것 같습니다. 이 함수를 설명해주고 싶다면 단순 // comment로 하는 것을 제안드리고 싶습니다. 한편, 코드로 충분히 다 전달이 되는 내용을 반복할 뿐이라면 주석이 없는 것도 하나의 방향일 것 같습니다.
CHANGELOG.md
Outdated
| - Config file must now be specified with `-c <CONFIG_PATH>` | ||
| - `--key` and `--cert` are now required as CLI options instead of being set in | ||
| the config file |
README.md
Outdated
|
|
||
| To run the application without specifying the configuration file path, save the | ||
| file to one of the following locations: | ||
| <!-- markdownlint-disable --> |
|
@pott-cho Could you rebase it onto main please? |
Close: #106