question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin Based Releases

See original GitHub issue

Description

The reference javascript implementation, is almost entirely plugin driven leaving the core library to be effectively a general harness that manages the execution of a plugin list and configuration passing.

Use cases

It would be nice to define a release process as a set of plugins, this also paves the way for shareable configurations and community driven functionality not directly supported by this project.

It would off load a good amount of complexity from the core library and allow people external to the project to implement new functionality and override existing behavior

Possible implementation

[tool.semantic-release]
extends = 'release-config-special'
plugins = [
  ['<plugin-name>', {
    option1 = true,
    option2 = 'a-value'
    option3 = 100
  }]
]

A plugin name is a reference to a python module.

#  plugin-name/__init__.py

def verify_conditions(*agrs, **kwargs):
  pass

def analyze_commits(*args, **kwargs):
  pass

def verify_release(*args, **kwargs):
  pass

def generate_notes(*args, **kwargs):
  pass

def prepare(*args, **kwargs):
  pass

def publish(*args, **kwargs):
  pass

def add_channel(*args, **kwargs):
  pass

def success(*args, **kwargs):
  pass

def fail(*args, **kwargs):
  pass

A plugin could also be a class or even a simple callbale, however, I think the expectation of a module that exports simple toplevel functions the easiest and most flexible thing

[tool.semantic-release]
extends = 'release-config-special'
plugins = [
  ['<plugin-name>', {
    option1 = true,
    option2 = 'a-value'
    option3 = 100
  }]
]
# plugin-name/__init__.py
from semantic_release import Plugin
__PLUGIN_NAME__ = 'PluginName'


class PluginName(Plugin):

  def __init__(*args, **kwargs):
    super().__init__(*args, **kwargs)

  def verify_conditions(*agrs, **kwargs):
    pass

  def analyze_commits(*args, **kwargs):
    pass

  def verify_release(*args, **kwargs):
    pass

  def generateNotes(*args, **kwargs):
    pass

  def prepare(*args, **kwargs):
    pass

  def publish(*args, **kwargs):
    pass

  def add_channel(*args, **kwargs):
    pass

  def success(*args, **kwargs):
    pass

  def fail(*args, **kwargs):
    pass

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danthcommented, Feb 11, 2021

I would prefer to use an abstract base class rather than exporting toplevel functions:

  • Plugins can inherit functionality from each other
  • Multiple plugins could be defined in a single module
  • __init__ could be used to load any plugin configuration before starting the release process
0reactions
github-actions[bot]commented, Nov 15, 2022

This feature request has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release - Jenkins Plugins
This plugin allows you to configure pre and post build actions that are executed when a release build is manually triggered.
Read more >
Nebula Release Plugin - GitHub
nebula-release-plugin ... This plugin provides opinions and tasks for the release process provided by gradle-git. Optional Configuration. If you want the release ......
Read more >
Releasing Plugins - jEdit
The following information makes up a release profile: Name- Plugins based on a standalone application should not have the same name as the...
Read more >
Releasing the Plugin – Core Performance - Make WordPress
Once the release branch exists, any pull requests that are relevant for that upcoming release need to be based on the release branch...
Read more >
@salesforce/plugin-release-management - npm
Plugin designed to handle all tasks related to signing, releasing, and testing npm packages. Releases. The following steps are automated for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found