Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing nop logic for custom properties plugin #738

Open
wants to merge 1 commit into
base: main-enterprise
Choose a base branch
from

Conversation

PendaGTP
Copy link
Contributor

@PendaGTP PendaGTP commented Jan 10, 2025

Fixes #734

Implements proper nop (dry-run) logic handling for Custom PropertIes plugin, aligning with documentation and other plugins.

Changes

  • Add nop mode support for property modifications
  • Add paginate for gettings all custom properties
  • Switch to built-in Octokit functions instead of github.request
  • Update API endpoint format from /repos/:org/:repo/properties/values to /repos/{owner}/{repo}/properties/values for consistency with GitHub API
  • Refactor property modification logic into a single modifyProperty method
  • Add debug logging for better troubleshooting
  • Normalize custom property names (from GH API) to lowercase to prevent case-sensitivity comparison issues
  • Update test cases

Note

Currently, organization properties are not fetched from the GH Organization API. When modifying repo custom properties, this results in a 422 error if the property isn't defined at the org level. Future improvements could:

  • Handle missing org properties to enable preview changes in nop mode
  • Add support for defining Organization custom properties (requires broader changes)

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.

Custom properties are applied during pull request
1 participant