Compare commits
4 Commits
7bf758f421
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
eb730f4ae0
|
|||
| 69eafc509a | |||
| f72f03e7d4 | |||
| 255e7fd5f0 |
@@ -0,0 +1,3 @@
|
||||
## v0.6.0 - 2025-11-18
|
||||
### Added
|
||||
* Append work package link to gitlab description after creating a WP from a gitlab issue
|
||||
Generated
+1
-1
@@ -183,7 +183,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cl-cli"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"gitlab",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cl-cli"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later"
|
||||
description = "Some helpers scripts for Champs-Libres"
|
||||
|
||||
@@ -63,7 +63,7 @@ editor $HOME/.config/cl-cli/config.toml
|
||||
|
||||
Then, fill it with the required configuration options:
|
||||
|
||||
- gitea personal access token:
|
||||
- gitea personal access token ([Access the page on gitea.champs-libres.be](https://gitea.champs-libres.be/user/settings/applications)):
|
||||
|
||||

|
||||
- Gitlab: [Create an access token](https://gitlab.com/-/user_settings/personal_access_tokens?name=cl-cli&scopes=api,read_user) With the "api" and "read_user" scopes
|
||||
|
||||
+25
-1
@@ -6,9 +6,12 @@ use crate::gitlab::issue::{Issue, IssueBundle, Project};
|
||||
use crate::openproject::client::Client;
|
||||
use crate::openproject::user::{GetMe, User};
|
||||
use crate::openproject::work::WorkPackageWriterAssignee;
|
||||
use crate::planning::utils::{append_related_issues, IssueRelated};
|
||||
use crate::planning::Issue2WorkActionTrait;
|
||||
use crate::planning::Issue2WorkResult;
|
||||
use gitlab::api::{issues, projects, AsyncQuery};
|
||||
use gitlab::api::projects::issues::EditIssue;
|
||||
use gitlab::api::{issues, projects, ApiError, AsyncQuery};
|
||||
use gitlab::RestError;
|
||||
use url::Url;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -71,6 +74,27 @@ impl Issue2WorkActionTrait for GitlabAction {
|
||||
.create_work_package(&(&dto).into(), &args.project_id)
|
||||
.await?;
|
||||
|
||||
let url_wp = format!(
|
||||
"{}/projects/{}/work_packages/{}",
|
||||
config.openproject.base_url, args.project_id, work_package.id
|
||||
);
|
||||
|
||||
let content =
|
||||
append_related_issues(&IssueRelated::OpenProjectIssue(url_wp), &issue.description);
|
||||
|
||||
let endpoint_put_result = EditIssue::builder()
|
||||
.project(issue.project_id)
|
||||
.issue(issue.iid)
|
||||
.description(content)
|
||||
.build();
|
||||
|
||||
if let Ok(endpoint_put) = endpoint_put_result {
|
||||
let r: Result<Issue, ApiError<RestError>> = endpoint_put.query_async(&client).await;
|
||||
if r.is_err() {
|
||||
eprintln!("Error while updating the issue description: {:?}", r);
|
||||
}
|
||||
}
|
||||
|
||||
let result = Issue2WorkResult {
|
||||
work_package_url: format!(
|
||||
"{}/projects/{}/work_packages/{}",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Champs-Libres Helper",
|
||||
"version": "0.5.0",
|
||||
"version": "0.6.0",
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "helper@champs-libres-coop",
|
||||
@@ -26,4 +26,4 @@
|
||||
"scripts": ["dist/background/background.js"],
|
||||
"type": "module"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "web-extension",
|
||||
"version": "0.5.0",
|
||||
"version": "0.6.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user