Skip to content

DEVPROD-27825 Set the default jira comment visibility to developers only#284

Draft
ahartschen wants to merge 2 commits intomainfrom
cursor/comment-privacy-default-1e86
Draft

DEVPROD-27825 Set the default jira comment visibility to developers only#284
ahartschen wants to merge 2 commits intomainfrom
cursor/comment-privacy-default-1e86

Conversation

@ahartschen
Copy link
Collaborator

DEVPROD-27825

Description

This PR addresses DEVPROD-27825 by defaulting Jira comments to private visibility to prevent unintended exposure of internal information on public projects.

  • Updated jiraClient.addComment to include a visibility property, restricting comments to a configurable Jira project role (defaults to "Developers").
  • Added jiraCommentVisibilityRole to the application config, allowing the role to be specified via the JIRA_COMMENT_VISIBILITY_ROLE environment variable.
  • Added DEFAULT_COMMENT_VISIBILITY_ROLE constant.

Testing

  • Updated jiraClient.test.ts to verify the visibility property is included in the addComment API call.
  • Ran all unit tests for jiraClient, SageAutoPRBotJiraPollingService, and CursorAgentStatusPollingService. All 25 tests passed.
  • Verified lint checks passed.

Open in Cursor Open in Web

- Add visibility restriction (type: 'role', value: 'Developers') to all
  comments posted via JiraClient.addComment()
- Add JIRA_COMMENT_VISIBILITY_ROLE env var for configuring the role name
  (defaults to 'Developers')
- Add DEFAULT_COMMENT_VISIBILITY_ROLE constant in jira/constants.ts
- Update jiraClient unit tests to verify visibility is set

This prevents unintended exposure of internal information when commenting
on public Jira projects (DEVPROD-27825).
@cursor
Copy link
Contributor

cursor bot commented Feb 10, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

/** SAGE_BOT_SUPPORTED_PROJECTS - comma-separated list of Jira project keys */
supportedProjects: string[];
/** JIRA_COMMENT_VISIBILITY_ROLE - Jira project role to restrict comment visibility (defaults to "Developers") */
jiraCommentVisibilityRole: string;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't need to specify any config for this. Just the constant in the addComment method will suffice.

@ahartschen
Copy link
Collaborator Author

@cursor address the feedback

@cursor
Copy link
Contributor

cursor bot commented Feb 10, 2026

Addressed the feedback:

  • Removed the jiraCommentVisibilityRole config property and JIRA_COMMENT_VISIBILITY_ROLE env var from src/config/index.ts
  • Simplified addComment in src/services/jira/jiraClient/index.ts to use the COMMENT_VISIBILITY_ROLE constant directly instead of reading from config
  • Renamed the constant from DEFAULT_COMMENT_VISIBILITY_ROLE to COMMENT_VISIBILITY_ROLE since it's no longer a "default" with a config override

All 33 tests pass and lint checks are clean.

Open in Cursor Open in Web

…ibility

Address PR feedback: remove JIRA_COMMENT_VISIBILITY_ROLE env var and
config property. Use the COMMENT_VISIBILITY_ROLE constant directly in
addComment instead.
@ahartschen ahartschen changed the title Comment privacy default DEVPROD-27825 Set the default comment visibility to Developers Feb 10, 2026
@ahartschen ahartschen changed the title DEVPROD-27825 Set the default comment visibility to Developers DEVPROD-27825 Set the default jira comment visibility to developers only Feb 10, 2026
@ahartschen
Copy link
Collaborator Author

I had to open an IT ticket for this because we don't have permission to set comments to the Developer role currently.

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