Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • S slapos.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 38
    • Merge requests 38
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • slapos.core
  • Merge requests
  • !786

promise: Introduce GenericPromise.allowBang()

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Xavier Thompson requested to merge xavier_thompson/slapos.core:feat/promise-disallow-bang-api into master Jun 04, 2025
  • Overview 14
  • Commits 4
  • Pipelines 0
  • Changes 2

Alternative to https://lab.nexedi.com/nexedi/slapos.core/-/merge_requests/785

Intended to be used in promise implementations like this:

@implementer(interface.IPromise)
class RunPromise(GenericPromise):
  def __init__(self, config):
    super(RunPromise, self).__init__(config)
    self.allowBang(False)

  def sense(self):
    # ...

  def anomaly(self):
    # no need to return TestResult to avoid calling bang
    # ...

Further, promise configuration in buildout like this

[promise]
...
config-bang-on-failure = false

is propagated directly to GenericPromise.allowBang(), independently of the specific promise implementation. The promise remains free to override this with an explicit allowBang() after the call to GenericPromise.__init__().

Edited Jul 11, 2025 by Xavier Thompson
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feat/promise-disallow-bang-api
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7