Once FeatureMap has been integrated into an application, the knowledge of which files are assigned to a given feature may be used during the publication of a release (or upon the merge to a main branch). The specific implementation depends largely on the structure of a given application, but broadly you may consider the following steps:
- Inspect the files that have been modified as part of a given release
- Use FeatureMap’s
for_filepublic interface to retrieve feature assignment data for each of those files - Collect and group changes to each associated feature
- This process can be aided by the
group_commitsandgenerate_release_notificationmethods exposed by FeatureMap
- This process can be aided by the
- Publish the change to a shared space, like Slack
The slack_release_log and slack_team_notifications commands do this for Slack.
Example GitHub Actions workflows
Both commands read the git history of the checkout and need ACCESS_TOKEN_GITHUB, a secret holding a token that can read the repository’s releases.
Post the changes since the last release to a Slack thread whenever the main branch changes:
name: Publish Changes to Release Log
on:
push:
branches: [main]
jobs:
release_log:
runs-on: ubuntu-latest
env:
ACCESS_TOKEN_GITHUB: ${{ secrets.ACCESS_TOKEN_GITHUB }}
RELEASE_LOG_SLACK_API_TOKEN: ${{ secrets.RELEASE_LOG_SLACK_API_TOKEN }}
RELEASE_LOG_SLACK_APP_USER_ID: ${{ vars.RELEASE_LOG_SLACK_APP_USER_ID }}
RELEASE_LOG_SLACK_CHANNEL_NAME: '#release-log'
RELEASE_LOG_SLACK_THREAD_PARENT_TS: ${{ vars.RELEASE_LOG_SLACK_THREAD_PARENT_TS }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec featuremap slack_release_log
Notify each team when a release is published:
name: Deliver Team Release Notifications
on:
release:
types: [published]
jobs:
team_notifications:
runs-on: ubuntu-latest
env:
RELEASE_REF: ${{ github.ref }}
ACCESS_TOKEN_GITHUB: ${{ secrets.ACCESS_TOKEN_GITHUB }}
ONBOARDING_SLACK_WEBHOOK: ${{ secrets.ONBOARDING_SLACK_WEBHOOK }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec featuremap slack_team_notifications
To try either command without posting, leave the Slack token or webhooks unset. The command prints the message it would have sent.