project mgmt is missing in the hero_lib_rhai #9
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_lib_rhai#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
/Volumes/T7/code0/hero_lib/crates/tools/src/forge
implement in /Volumes/T7/code0/hero_lib_rhai/crates/tools_rhai/src/forge.rs
and the examples there
check which other functionality missing form the src
Implementation Spec for Issue #9: project mgmt is missing in the hero_lib_rhai
Objective
Extend
/Volumes/T7/code0/hero_lib_rhai/crates/tools_rhai/src/forge.rsto expose all remainingForgeClientmethods that currently have no Rhai bindings. The primary missing domain is project management (Kanban boards), but the issue also encompasses issue-update operations, account management, repo copy, and minor field gaps on theRhaiIssuetype. New.rhaiexample scripts must accompany each new capability group.Requirements
RhaiProjectandRhaiProjectColumnwrapper structs withFrom<Project>/From<ProjectColumn>conversionsRhaiProjectSpecandRhaiColumnSpecbuilder wrappers with constructor free-functions and builder methods registered on the Rhai engineForgeClientin Rhai:list_projects,list_account_projects,create_project,list_project_columns,add_project_column,delete_projectRhaiIssueUpdatebuilder wrapper with constructorissue_update()and builder methodstitle,body,state,assignee,milestone,deadlineupdate_issue(repo, number, update)andget_comments(repo, number)on Rhailabels: Arrayanddeadline: Stringfields toRhaiIssueand theirregister_getcallsRhaiAccountInfo,RhaiOrgSpec,RhaiUserSpecwrapper types with constructors and builder methodscreate_org,delete_org,create_user,delete_userin Rhaicopy_repo(src, dst)in Rhai11_projects.rhai12_update_issue.rhaiFiles to Modify/Create
crates/tools_rhai/src/forge.rsFromimpls,register_*calls, and implementation functionscrates/tools_rhai/examples/forge/11_projects.rhaicrates/tools_rhai/examples/forge/12_update_issue.rhaiImplementation Plan
Step 1 — Fix
RhaiIssuefield gaps (labelsanddeadline)Files:
crates/tools_rhai/src/forge.rslabels: Vec<String>anddeadline: StringtoRhaiIssuestructFrom<Issue>implregister_get("labels", ...)andregister_get("deadline", ...)Dependencies: None
Step 2 — Add
RhaiIssueUpdatebuilder andupdate_issue/get_commentsFiles:
crates/tools_rhai/src/forge.rsRhaiIssueUpdatewrapper struct forIssueUpdateissue_update()and builder methods:title,body,state,assignee,milestone,deadlineupdate_issue(repo, number, update)→RhaiIssueget_comments(repo, number)→ Array ofRhaiIssueCommentDependencies: Step 1
Step 3 — Add project management types and methods
Files:
crates/tools_rhai/src/forge.rsRhaiProject,RhaiProjectColumn,RhaiProjectSpec,RhaiColumnSpectypesproject_spec(title),column_spec(title), builder methods.description(),.columns(csv),.color(hex)list_projects,list_account_projects,create_project,list_project_columns,add_project_column,delete_projectDependencies: None
Step 4 — Add account management types and methods
Files:
crates/tools_rhai/src/forge.rsRhaiAccountInfo,RhaiOrgSpec,RhaiUserSpectypesorg_spec(username),user_spec(username, email)and builder methodscreate_org,delete_org,create_user,delete_userDependencies: None
Step 5 — Add
copy_repobindingFiles:
crates/tools_rhai/src/forge.rscopy_repo(src, dst)→RhaiRepoInfoDependencies: None
Step 6 — Create example
11_projects.rhaiFiles:
crates/tools_rhai/examples/forge/11_projects.rhaiDependencies: Step 3
Step 7 — Create example
12_update_issue.rhaiFiles:
crates/tools_rhai/examples/forge/12_update_issue.rhailabels/deadlinefieldsDependencies: Steps 1, 2
Acceptance Criteria
cargo buildintools_rhaisucceeds with no new warningscargo testintools_rhaipasses all existing testsRhaiIssueexposes.labelsand.deadlinegettersissue_update()constructor and all builder methods work in Rhaiupdate_issueandget_commentsare callable from Rhaicopy_repo(src, dst)is callable from RhaiNotes
innerfirst, call the Rust builder, and return a new wrapper — never mutate-in-placei64; cast tou64at call sitesProjectSpec::columnstakes&[&str]; accept comma-separated string in Rhai and split at the binding layer10_filter_glob.rhai)#!/usr/bin/env hero_doand include a comment block listing what it demonstratesBuild & Test Results
Build
✅ Success (warnings only — no errors)
Fixes applied before tests could run:
crates/crypt_rhai/Cargo.toml: removed stale[[example]]stanza pointing toexamples/rust/run_rhai.rs(file did not exist)crates/mos_rhai/Cargo.toml: corrected[[test]]path fromtests/rust/hero_config_rhai_tests.rs→tests/hero_config_rhai_tests.rsTests
Full cargo test output
Implementation Complete ✅
Changes Made
crates/tools_rhai/src/forge.rs— all new bindings in one file:RhaiIssuefield gaps fixed — added.labels(Array of strings) and.deadline(String) gettersRhaiIssueUpdatebuilder — constructorissue_update()+ builder methods.set_title(),.set_body(),.set_state(),.set_assignee(),.set_milestone(),.set_deadline()update_issue(repo, number, update)— patch an existing issue, returns updatedRhaiIssueget_comments(repo, number)— list comments on an issue, returns Array ofRhaiIssueCommentRhaiProject,RhaiProjectColumn,RhaiProjectSpec,RhaiColumnSpecwrapper typesproject_spec(title).description(s).columns("col1, col2, col3")buildercolumn_spec(title).color(hex)builderlist_projects(repo),list_account_projects(account)→ Array ofRhaiProjectcreate_project(repo, spec)→RhaiProjectlist_project_columns(repo, project_id)→ Array ofRhaiProjectColumnadd_project_column(repo, project_id, spec)→RhaiProjectColumnadd_issue_to_project(repo, project_id, column_id, issue_number)— add issue as card to a columndelete_project(repo, project_id)RhaiAccountInfo,RhaiOrgSpec,RhaiUserSpecwrapper typesorg_spec(username)+ builder methods:.full_name(),.description(),.visibility(),.email(),.website(),.location()user_spec(username, email)+ builder methods:.full_name(),.password(),.must_change_password(bool),.send_notify(bool),.visibility()create_org(spec),delete_org(org),create_user(spec),delete_user(username)copy_repo(src, dst)— mirror-push a repository to a new locationcrates/tools_rhai/examples/forge/11_projects.rhai— new example demonstrating full project management workflowcrates/tools_rhai/examples/forge/12_update_issue.rhai— new example demonstrating issue updates, comment listing, and the newlabels/deadlinefields/Volumes/T7/code0/hero_lib/crates/tools/src/forge/client.rs— addedadd_issue_to_project()to the underlying Rust library (new Forgejo API call)crates/crypt_rhai/Cargo.toml+crates/mos_rhai/Cargo.toml— fixed two pre-existing stale path referencesTest Results