Skip to content

Remove undocumented view deletion attempts in campaign project creation#10367

Merged
mnkiefer merged 5 commits intomainfrom
copilot/update-project-default-view
Jan 16, 2026
Merged

Remove undocumented view deletion attempts in campaign project creation#10367
mnkiefer merged 5 commits intomainfrom
copilot/update-project-default-view

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

GitHub's Projects v2 API doesn't officially support deleting or updating views. The previous implementation attempted to delete the default "View 1" after creating custom views using an undocumented GraphQL mutation, which would fail silently.

Changes

  • Removed view deletion logic: Removed deleteProjectView() and deleteDefaultView() functions that used the undocumented deleteProjectV2View GraphQL mutation
  • Simplified view creation: Configured views are now created as additional views without attempting to delete or modify the default "View 1"
  • Updated documentation: Clarified that "View 1" remains and configured views are created as additional views

Research Findings

After verification of GitHub's API documentation:

  1. No PATCH/PUT REST endpoint exists for updating ProjectV2 views
  2. No documented GraphQL mutation exists for deleting or updating ProjectV2 views
  3. The deleteProjectV2View mutation is not officially documented or supported

Implementation

// Create configured views as additional views
for (let i = 0; i < configuredViews.length; i++) {
  const viewConfig = configuredViews[i];
  await createProjectView(projectInfo.projectUrl, viewConfig);
}

// Note: GitHub's default "View 1" will remain. The deleteProjectV2View GraphQL mutation
// is not documented and may not work reliably. Configured views are created as additional views.

This approach works within GitHub's officially documented API capabilities. The default "View 1" remains in the project, and configured views are created as view #2, #3, etc.

Original prompt

Since we can't remove views, let's use update-project and rename the table default view1 in the project board to our board view in campaigns.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 16, 2026 20:25
- Remove deleteDefaultView and deleteProjectView functions
- Add updateProjectView function to rename/update existing views
- Update view creation logic to rename "View 1" to first configured view instead of trying to delete it
- This fixes the issue where GitHub API doesn't allow deleting views

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Update safe-outputs.md to explain that first view replaces "View 1"
- Remove outdated text about deleting the default view

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Update project board default view to our board view in campaigns Replace view deletion with view update for campaign project boards Jan 16, 2026
Copilot AI requested a review from mnkiefer January 16, 2026 20:31
@mnkiefer
Copy link
Contributor

@copilot Check that this graphql mutation actually exists.

The deleteProjectV2View GraphQL mutation is not documented in GitHub's official API.
Research confirms that neither REST PATCH endpoints nor GraphQL mutations for
updating/deleting ProjectV2 views are officially supported.

Solution: Simply create configured views without attempting to delete "View 1".
The default view will remain, and configured views are created as additional views.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot Check that this graphql mutation actually exists.

You're correct. After checking GitHub's API documentation, I found that:

  1. No PATCH/PUT REST endpoint exists for updating ProjectV2 views
  2. No documented GraphQL mutation exists for deleting or updating views
  3. The original deleteProjectV2View mutation was also undocumented

The solution in commit 3c830d7 removes all view deletion/update attempts. GitHub's default "View 1" will remain, and configured views are created as additional views.

Copilot AI changed the title Replace view deletion with view update for campaign project boards Remove undocumented view deletion attempts in campaign project creation Jan 16, 2026
@mnkiefer mnkiefer marked this pull request as ready for review January 16, 2026 21:21
@mnkiefer mnkiefer merged commit c53a6cb into main Jan 16, 2026
48 of 49 checks passed
@mnkiefer mnkiefer deleted the copilot/update-project-default-view branch January 16, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants