Skip to content

Commit 2b6c5ed

Browse files
feat: rename edit-wiki-page to update-wiki-page (#66)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
1 parent 87d6527 commit 2b6c5ed

8 files changed

Lines changed: 89 additions & 89 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Alongside the correctly generated pipeline yaml, an agent file is generated from
4141
│ ├── mod.rs
4242
│ ├── create_pr.rs
4343
│ ├── create_work_item.rs
44-
│ ├── edit_wiki_page.rs
44+
│ ├── update_wiki_page.rs
4545
│ ├── memory.rs
4646
│ ├── missing_data.rs
4747
│ ├── missing_tool.rs
@@ -894,7 +894,7 @@ safe-outputs:
894894
- Content validation: text files are scanned for `##vso[` commands
895895
- Extension filtering: can restrict to specific file types
896896

897-
#### edit-wiki-page
897+
#### update-wiki-page
898898
Updates the content of an existing Azure DevOps wiki page. The wiki page must already exist; this tool edits its content but does not create new pages.
899899

900900
**Agent parameters:**
@@ -905,7 +905,7 @@ Updates the content of an existing Azure DevOps wiki page. The wiki page must al
905905
**Configuration options (front matter):**
906906
```yaml
907907
safe-outputs:
908-
edit-wiki-page:
908+
update-wiki-page:
909909
wiki-name: "MyProject.wiki" # Required — wiki identifier (name or GUID)
910910
wiki-project: "OtherProject" # Optional — ADO project that owns the wiki; defaults to current pipeline project
911911
path-prefix: "/agent-output" # Optional — prepended to the agent-supplied path (restricts write scope)

src/compile/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ pub fn generate_executor_ado_env(write_service_connection: Option<&str>) -> Stri
553553
}
554554

555555
/// Safe-output names that require write access to ADO.
556-
const WRITE_REQUIRING_SAFE_OUTPUTS: &[&str] = &["create-pull-request", "create-work-item", "create-wiki-page", "edit-wiki-page"];
556+
const WRITE_REQUIRING_SAFE_OUTPUTS: &[&str] = &["create-pull-request", "create-work-item", "create-wiki-page", "update-wiki-page"];
557557

558558
/// Validate that write-requiring safe-outputs have a write service connection configured.
559559
pub fn validate_write_permissions(front_matter: &FrontMatter) -> Result<()> {

src/execute.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::path::Path;
1010

1111
use crate::ndjson::{self, SAFE_OUTPUT_FILENAME};
1212
use crate::tools::{
13-
CreatePrResult, CreateWikiPageResult, CreateWorkItemResult, EditWikiPageResult,
13+
CreatePrResult, CreateWikiPageResult, CreateWorkItemResult, UpdateWikiPageResult,
1414
ExecutionContext, ExecutionResult, Executor,
1515
};
1616

@@ -182,12 +182,12 @@ pub async fn execute_safe_output(
182182
);
183183
output.execute_sanitized(ctx).await?
184184
}
185-
"edit-wiki-page" => {
186-
debug!("Parsing edit-wiki-page payload");
187-
let mut output: EditWikiPageResult = serde_json::from_value(entry.clone())
188-
.map_err(|e| anyhow::anyhow!("Failed to parse edit-wiki-page: {}", e))?;
185+
"update-wiki-page" => {
186+
debug!("Parsing update-wiki-page payload");
187+
let mut output: UpdateWikiPageResult = serde_json::from_value(entry.clone())
188+
.map_err(|e| anyhow::anyhow!("Failed to parse update-wiki-page: {}", e))?;
189189
debug!(
190-
"edit-wiki-page: path='{}', content length={}",
190+
"update-wiki-page: path='{}', content length={}",
191191
output.path,
192192
output.content.len()
193193
);
@@ -396,19 +396,19 @@ mod tests {
396396
}
397397

398398
#[tokio::test]
399-
async fn test_execute_malformed_edit_wiki_page_returns_err() {
399+
async fn test_execute_malformed_update_wiki_page_returns_err() {
400400
// Missing required fields (path and content)
401-
let entry = serde_json::json!({"name": "edit-wiki-page"});
401+
let entry = serde_json::json!({"name": "update-wiki-page"});
402402
let ctx = ExecutionContext::default();
403403

404404
let result = execute_safe_output(&entry, &ctx).await;
405405
assert!(result.is_err());
406406
}
407407

408408
#[tokio::test]
409-
async fn test_execute_edit_wiki_page_missing_context() {
409+
async fn test_execute_update_wiki_page_missing_context() {
410410
let entry = serde_json::json!({
411-
"name": "edit-wiki-page",
411+
"name": "update-wiki-page",
412412
"path": "/Overview",
413413
"content": "This is some valid wiki content."
414414
});

src/mcp.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::sanitize::sanitize as sanitize_text;
1313
use crate::tools::{
1414
CreatePrParams, CreatePrResult, CreateWikiPageParams, CreateWikiPageResult,
1515
CreateWorkItemParams, CreateWorkItemResult,
16-
EditWikiPageParams, EditWikiPageResult, MissingDataParams, MissingDataResult,
16+
UpdateWikiPageParams, UpdateWikiPageResult, MissingDataParams, MissingDataResult,
1717
MissingToolParams, MissingToolResult, NoopParams, NoopResult, ToolResult,
1818
anyhow_to_mcp_error,
1919
};
@@ -406,17 +406,17 @@ impl SafeOutputs {
406406
}
407407

408408
#[tool(
409-
name = "edit-wiki-page",
409+
name = "update-wiki-page",
410410
description = "Create or update an Azure DevOps wiki page with the provided markdown content. \
411411
The page path (e.g. '/Overview/Architecture') and the wiki to write to are determined by the \
412412
pipeline configuration. Use this to publish findings, summaries, documentation, or any other \
413413
structured output that should be visible in the project wiki."
414414
)]
415-
async fn edit_wiki_page(
415+
async fn update_wiki_page(
416416
&self,
417-
params: Parameters<EditWikiPageParams>,
417+
params: Parameters<UpdateWikiPageParams>,
418418
) -> Result<CallToolResult, McpError> {
419-
info!("Tool called: edit-wiki-page - '{}'", params.0.path);
419+
info!("Tool called: update-wiki-page - '{}'", params.0.path);
420420
debug!("Content length: {} chars", params.0.content.len());
421421

422422
// Sanitize untrusted agent-provided text fields (IS-01).
@@ -431,7 +431,7 @@ structured output that should be visible in the project wiki."
431431
sanitized.content = sanitize_text(&sanitized.content);
432432
sanitized.comment = sanitized.comment.map(|c| sanitize_text(&c));
433433

434-
let result: EditWikiPageResult = sanitized.try_into()?;
434+
let result: UpdateWikiPageResult = sanitized.try_into()?;
435435
let _ = self.write_safe_output_file(&result).await;
436436

437437
info!("Wiki page edit queued: '{}'", result.path);
@@ -445,7 +445,7 @@ structured output that should be visible in the project wiki."
445445
name = "create-wiki-page",
446446
description = "Create a new Azure DevOps wiki page with the provided markdown content. \
447447
The page path (e.g. '/Overview/NewPage') and the wiki to write to are determined by the \
448-
pipeline configuration. The page must not already exist — use edit-wiki-page to update \
448+
pipeline configuration. The page must not already exist — use update-wiki-page to update \
449449
existing pages. Use this to publish findings, summaries, documentation, or any other \
450450
structured output that should be visible in the project wiki."
451451
)]

src/tools/create_wiki_page.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl Executor for CreateWikiPageResult {
269269
if page_exists {
270270
return Ok(ExecutionResult::failure(format!(
271271
"Wiki page '{effective_path}' already exists. \
272-
Use the edit-wiki-page safe output to update existing pages."
272+
Use the update-wiki-page safe output to update existing pages."
273273
)));
274274
}
275275

@@ -310,7 +310,7 @@ impl Executor for CreateWikiPageResult {
310310
if put_status.as_u16() == 412 {
311311
return Ok(ExecutionResult::failure(format!(
312312
"Wiki page '{effective_path}' already exists (conflict detected during creation). \
313-
Use the edit-wiki-page safe output to update existing pages."
313+
Use the update-wiki-page safe output to update existing pages."
314314
)));
315315
}
316316

@@ -798,7 +798,7 @@ wiki-name: "MyProject.wiki"
798798
let result = if page_exists {
799799
Some(ExecutionResult::failure(format!(
800800
"Wiki page '{effective_path}' already exists. \
801-
Use the edit-wiki-page safe output to update existing pages."
801+
Use the update-wiki-page safe output to update existing pages."
802802
)))
803803
} else {
804804
None
@@ -818,7 +818,7 @@ wiki-name: "MyProject.wiki"
818818
let result: Option<ExecutionResult> = if page_exists {
819819
Some(ExecutionResult::failure(format!(
820820
"Wiki page '{effective_path}' already exists. \
821-
Use the edit-wiki-page safe output to update existing pages."
821+
Use the update-wiki-page safe output to update existing pages."
822822
)))
823823
} else {
824824
None

src/tools/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub(crate) const PATH_SEGMENT: &AsciiSet = &CONTROLS.add(b'#').add(b'?').add(b'/
1212
mod create_pr;
1313
mod create_wiki_page;
1414
mod create_work_item;
15-
mod edit_wiki_page;
15+
mod update_wiki_page;
1616
pub mod memory;
1717
mod missing_data;
1818
mod missing_tool;
@@ -22,7 +22,7 @@ mod result;
2222
pub use create_pr::*;
2323
pub use create_wiki_page::*;
2424
pub use create_work_item::*;
25-
pub use edit_wiki_page::*;
25+
pub use update_wiki_page::*;
2626
pub use missing_data::*;
2727
pub use missing_tool::*;
2828
pub use noop::*;

0 commit comments

Comments
 (0)