Skip to content

Conversation

gerardvanengelen
Copy link

Custom Revision Template for NewRelic Service

Goal

Allow specifying a custom revision template for the NewRelic notification service, which enables support for projects with multiple sources. The default template assumes a specific structure ({{.app.status.operationState.syncResult.revision}}) that doesn't work for all project configurations, especially those with multiple sources.

Changes Made

  • Modified the NewrelicNotification.GetTemplater method to use the Revision field as a template string when provided by the user
  • Maintained backward compatibility by keeping the default template when no custom revision is specified
  • Aligned the implementation with the pattern used by other fields (Changelog and User) that already support custom templates

Tests Added

Updated TestGetTemplater_Newrelic in newrelic_test.go with two test cases:

  1. "default revision template" - Tests the original behavior where the default template {{.app.status.operationState.syncResult.revision}} is used when no custom Revision is provided
  2. "custom revision template" - Tests the new functionality where a custom template specified in the Revision field ({{.app.status.custom.revision}}) is used instead of the default

These tests verify that users can now configure custom paths to retrieve revision information that matches their specific project structure, including support for multiple sources.

@gerardvanengelen gerardvanengelen force-pushed the feat/enable-newrelic.revision-on-new-relic-service branch from 2b1e3cd to 69e962c Compare May 1, 2025 04:56
@GVengelen
Copy link

@pasha-codefresh Sorry to ping you directly, can you let me know if there are additional steps I need to take to get this reviewed?
This change would really help me, so it would be a shame if it is not reviewed because I miss something.

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