Skip to content

Comments

Implement direct ServiceNow PR governance#3242

Merged
michaeljguarino merged 1 commit intomasterfrom
mjg/prod-4467-add-first-class-servicenow-pr-governance-controller
Feb 22, 2026
Merged

Implement direct ServiceNow PR governance#3242
michaeljguarino merged 1 commit intomasterfrom
mjg/prod-4467-add-first-class-servicenow-pr-governance-controller

Conversation

@michaeljguarino
Copy link
Member

This is a common ask, and it seems like a lot of orgs don't have bandwidth to implement themselves. The intended workflow is described in the governance impl, and seems to imitate the common ticket workflows I've seen.

Test Plan

unit tests

Checklist

  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a meaningful title and summary to convey the impact of this PR to a user.

Plural Flow: console

@michaeljguarino michaeljguarino requested a review from a team February 22, 2026 02:11
@michaeljguarino michaeljguarino added the enhancement New feature or request label Feb 22, 2026
@linear
Copy link

linear bot commented Feb 22, 2026

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 22, 2026

Greptile Summary

Implements ServiceNow integration for PR governance, enabling automated change request creation and lifecycle management synchronized with PR workflows.

Key Changes

  • New ServiceNow client with Change Management API support
  • Governance workflow: PR creation → ServiceNow change → approval → merge → closure
  • AI-powered generation of ServiceNow change attributes using LLM tool calls
  • State machine for walking through ServiceNow change states with retries
  • Polling pipeline for auto-merging approved governance PRs
  • Database schema additions for governance type and polling timestamps

Implementation Details

The workflow synchronizes PR lifecycle with ServiceNow changes:

  1. PR creation triggers ServiceNow change request with AI-generated attributes
  2. ServiceNow approval moves change to implement state and approves PR
  3. PR merge walks through ServiceNow states to close successfully
  4. PR close cancels the ServiceNow change

The implementation includes comprehensive unit tests and uses encrypted storage for ServiceNow credentials.

Confidence Score: 4/5

  • Safe to merge with standard review - well-tested implementation with minor areas for potential improvement
  • Solid implementation with comprehensive tests and proper error handling. The ServiceNow state machine is well-designed with retry logic. Minor deduction for the complexity of the state walking logic and AI-powered attribute generation which may need real-world validation
  • Pay attention to lib/console/deployments/pr/governance/impl/service_now.ex for the state machine logic and AI attribute generation

Important Files Changed

Filename Overview
lib/console/deployments/pr/governance/impl/service_now.ex New ServiceNow governance implementation with proper workflow state machine and AI-powered change attribute generation
lib/console/clients/service_now/client.ex ServiceNow API client with proper authentication and error handling
lib/console/deployments/pr/governance/provider.ex Updated provider router to support ServiceNow governance with proper error handling
lib/console/schema/pr_governance.ex Added ServiceNow configuration schema with encrypted password field
lib/console/pipelines/pr_governance/pipeline.ex Pipeline consumer for auto-merging approved governance PRs
test/console/deployments/pr/governance/service_now_test.exs Comprehensive unit tests covering open, confirm, and close workflows

Last reviewed commit: eec368d

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

63 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@michaeljguarino michaeljguarino force-pushed the mjg/prod-4467-add-first-class-servicenow-pr-governance-controller branch from 4c8f06b to eec368d Compare February 22, 2026 02:34
@michaeljguarino
Copy link
Member Author

@greptileai

@michaeljguarino michaeljguarino force-pushed the mjg/prod-4467-add-first-class-servicenow-pr-governance-controller branch from eec368d to 6b79c01 Compare February 22, 2026 02:59
This is a common ask, and it seems like a lot of orgs don't have bandwidth to implement themselves.  The intended workflow is described in the governance impl, and seems to imitate the common ticket workflows I've seen.
@michaeljguarino michaeljguarino force-pushed the mjg/prod-4467-add-first-class-servicenow-pr-governance-controller branch from 6b79c01 to 0133020 Compare February 22, 2026 03:07
@michaeljguarino michaeljguarino merged commit 94b28ad into master Feb 22, 2026
25 checks passed
@michaeljguarino michaeljguarino deleted the mjg/prod-4467-add-first-class-servicenow-pr-governance-controller branch February 22, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants