Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • S slapos.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 31
    • Merge requests 31
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slapos.core
  • Merge requests
  • !786

Open
Created Jun 04, 2025 by Xavier Thompson@xavier_thompsonOwner
  • Report abuse
Report abuse

Draft: promise: Introduce GenericPromise.allowBang()

  • Overview 8
  • Commits 2
  • Changes 1

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 Jun 04, 2025 by Xavier Thompson
Assignee
Assign to
Reviewer
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