feat: new commands in mm channels and gitea issues #6

Open
蔡雨翔524370910013 wants to merge 12 commits from arthurcai/Joint-Teapot:master into master
First-time contributor

Main Changes

Doc

  • Updated README and added README for new commands

Gitea Issues

  • Added command to close issues
  • Added command to delete issue labels
  • Added command to label issues (if not exist, will create new labels)

Mattermost

  • Added command to update mm channels (group and personal)
## Main Changes ### Doc - Updated README and added README for new commands ### Gitea Issues - Added command to close issues - Added command to delete issue labels - Added command to label issues (if not exist, will create new labels) ### Mattermost - Added command to update mm channels (group and personal)
蔡雨翔524370910013 added 7 commits 2025-09-19 19:50:29 +08:00
Author
First-time contributor

The fixes the problem of #3. Not sure whether code quality/effects is okay... The label adding and deleting is tested in engr151/test-repo.

The fixes the problem of #3. Not sure whether code quality/effects is okay... The label adding and deleting is tested in engr151/test-repo.
蔡雨翔524370910013 added 1 commit 2025-09-19 22:54:45 +08:00
蔡雨翔524370910013 added 2 commits 2025-09-20 14:29:18 +08:00
Author
First-time contributor

pre-commit check passed after switching to pycln 2.5.0

pre-commit check passed after switching to pycln 2.5.0
张泊明518370910136 added 1 commit 2025-09-21 11:29:48 +08:00
张泊明518370910136 requested changes 2025-09-21 19:32:41 +08:00
@ -169,1 +169,4 @@
@app.command(
"close-issues",
help="close specific issues in a repository: joint-teapot close-issues REPO_NAME ISSUE_NUMBER [ISSUE_NUMBER ...]",

no need to add sample usage in help text, typer will generate it

no need to add sample usage in help text, typer will generate it
@ -170,0 +175,4 @@
repo_name: str,
issue_numbers: List[int] = Argument(..., help="One or more issue numbers to close"),
dry_run: bool = Option(
False, "--dry-run/--no-dry-run", help="Enable dry run (no changes will be made)"

"--dry-run/--no-dry-run" is also auto generated by typer

`"--dry-run/--no-dry-run"` is also auto generated by typer
@ -170,0 +219,4 @@
),
repo: bool = Option(
False,
"--repo",

ditto

ditto
@ -548,6 +590,492 @@ class Gitea:
self.create_milestone(repo_name, milestone, description, due_date)
logger.info(f"Created milestone {milestone} in {repo_name}")
def label_issues(

function body too long

function body too long
@ -551,0 +1038,4 @@
path = f"/repos/{self.org_name}/{repo_name}/labels/{enc_name}"
url = f"{self.api_client.configuration.host}{path}"
try:
resp = requests.delete(url, headers=headers_local, timeout=10)

Does focs_gitea provide this endpoint?

Does `focs_gitea` provide this endpoint?
Author
First-time contributor

focs_gitea seems not to provide the endpoint/api to create labels. Also, using the label issue directly result in a failure on my computer, the issue can't be labeled.

focs_gitea seems not to provide the endpoint/api to create labels. Also, using the label issue directly result in a failure on my computer, the issue can't be labeled.

Does self.issue_api.issue_create_label and self.issue_api.issue_delete_label work?

Does `self.issue_api.issue_create_label` and `self.issue_api.issue_delete_label` work?
Author
First-time contributor

Sorry, not tried. I thought that if label-issue failed then the other two might be failed. Will refactor to try to use these two tonight.

Sorry, not tried. I thought that if label-issue failed then the other two might be failed. Will refactor to try to use these two tonight.
蔡雨翔524370910013 added 1 commit 2025-09-21 23:20:57 +08:00
Author
First-time contributor

refactored, dry-run issue fixed.

refactored, dry-run issue fixed.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u master:arthurcai-master
git checkout arthurcai-master

Merge

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff arthurcai-master
git checkout master
git merge --ff-only arthurcai-master
git checkout arthurcai-master
git rebase master
git checkout master
git merge --no-ff arthurcai-master
git checkout master
git merge --squash arthurcai-master
git checkout master
git merge --ff-only arthurcai-master
git checkout master
git merge arthurcai-master
git push origin master
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: JOJ/Joint-Teapot#6
No description provided.