Skip to content

Comments

fix: allow expressions in GitHub comment repository#3227

Open
hadzija7 wants to merge 2 commits intosuperplanehq:mainfrom
hadzija7:fix/github-comment-repo-expression
Open

fix: allow expressions in GitHub comment repository#3227
hadzija7 wants to merge 2 commits intosuperplanehq:mainfrom
hadzija7:fix/github-comment-repo-expression

Conversation

@hadzija7
Copy link

Summary

  • skip setup-time installation repository validation in github.createIssueComment when repository is an expression template
  • keep existing validation behavior for literal repository values
  • add a focused setup test covering expression-based repository configuration

Why

Test plan

  • Added unit test: repository expression skips setup validation
  • Run full test suite

Skip setup-time repository installation validation for templated repository values in github.createIssueComment so expression-based workflows can be configured successfully.

Signed-off-by: hadzija7 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@hadzija7 hadzija7 force-pushed the fix/github-comment-repo-expression branch from df04599 to 877453a Compare February 23, 2026 14:17
Comment on lines 124 to 129
// Repository can be expression-based (resolved at runtime), so skip
// setup-time installation validation for templated values.
if strings.Contains(config.Repository, "{{") {
return nil
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

The reported bug happens inside ensureRepoInMetadata. Let's remove it from here and add a expression regex validation in ensureRepoInMetadata.

an example of regex validation is in https://github.com/hadzija7/superplane/blob/877453ab3b05df459af120d7fb9c9e60a2c9f67b/pkg/configuration/validation.go#L262

If hasExpressions -> ignore the check.

Note: I noticed we are doing the same thing in bitbucket

Copy link
Author

Choose a reason for hiding this comment

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

hey @forestileao, can you check now?

Move expression-aware repository validation into ensureRepoInMetadata so GitHub components consistently skip installation access checks for templated repository values.

Signed-off-by: hadzija7 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on March 12

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

"github.com/superplanehq/superplane/pkg/crypto"
)

var expressionPlaceholderRegex = regexp.MustCompile(`(?s)\{\{.*?\}\}`)
Copy link

Choose a reason for hiding this comment

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

Duplicated regex variable across three packages

Low Severity

The expressionPlaceholderRegex variable is now duplicated in three separate packages: pkg/configuration/validation.go, pkg/integrations/sendgrid/create_or_update_contact.go, and the newly added one in pkg/integrations/github/common.go. All three use the identical pattern. This increases the risk of inconsistency if the expression syntax evolves. Extracting this into a shared, exported location would be cleaner.

Fix in Cursor Fix in Web

Copy link
Author

Choose a reason for hiding this comment

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

could maybe refactor this in a separate PR? @forestileao

@AleksandarCole AleksandarCole added the pr:stage-3/3 Ready for full, in-depth, review label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:stage-3/3 Ready for full, in-depth, review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub comment rejects repo expression

3 participants