Giter Club home page Giter Club logo

sebex's Introduction

Sebex

The ultimate assistant in Membrane Framework releasing & development.

Installation

Sebex is a Python application and is officially supported on Linux and macOS systems. At least Python 3.8 is required. There is also Elixir analysis code, which is written in Elixir itself and distributed as an escript. For this to work, a reasonably fresh Erlang installation is also needed.

Currently, building and installation directly from source code is the recommended way, and the whole procedure is scripted using a makefile:

git clone https://github.com/membraneframework/sebex.git
cd sebex
make install

Under the hood this will build Elixir analyzer script and place it in the expected place, then it will install sebex package issuing pip install --user . command.

To update your existing installation, invoke make install again.

Usage

Setup communication with GitHub API

Make sure the repositories of your GitHub Organization are public. To allow Sebex to edit your repositories:

Preparation

It's advisable to use the --workspace and --profile options when running Sebex or to set the corresponding env vars: SEBEX_WORKSPACE and SEBEX_PROFILE.

  • The workspace is a directory, where sebex clones repositories, so that it can work on them later on. It also contains .sebex subdirectory, with some metadata files needed for sebex to run properly. The default workspace (applicable to a situation in which you haven't explicitly specified the workspace) is the directory, from which you are running the sebex.
  • The profile helps you manage different sebex configurations. Each profile is described by the <profile name>.txt text file inside the <workspace_directory>/.sebex/profiles/ directory. You need to create that file on your own. An exemplary profile description file can be found inside examples/ subdirectory of this repository. Note, that the <profile name>.txt file has a .txt extension - later on, you will be able to refer to it with --profile <profile name> option within the command syntax.

To add an organization run:

sebex bootstrap -o <Github organization name>

This will create the manifest.yaml inside the .sebex subdirectory of your workspace directory. The manifest will contain a list of all public repositories in that organization. To exclude broken or unsupported repositories from further analysis add a new line containing !<project name> to your <workspace directory>/.sebex/profiles/<your profile>.txt file.

To perform further work Sebex must clone your organization's repositories to your local workspace:

sebex sync

You can view the dependency graph of your projects:

sebex graph --view

Releasing packages

Prepare a release plan by listing the project names (names of the repositories) of the packages you want to release. After passing the name of each project, you will be asked to pass a tag of the version, which will be released. At least one project name needs to be passed. When you are done with listing the needed projects, simply press enter.

sebex release plan
Project: sebex_test_b
Version: 0.10.0
Project: sebex_test_e
Version: 0.6.0
Project:

Important! All the projects updated with sebex must be Mix projects, with the @version tag inside their mix.exs file. All listed packages as well as their dependent packages will be bumped by one minor version (e.g. 0.2.1 -> 0.3.0).

Release "Purely Easy Wahoo"
===========================

1. Phase "Surely Vocal Kitten"
 * sebex_test_b, 0.2.0 -> 0.3.0, publish
 * sebex_test_e, 0.2.0 -> 0.3.0, publish
2. Phase "Easily Moved Tarpon"
 * sebex_test_c, 0.2.0 -> 0.3.0, publish
 dependencies: sebex_test_b, "~> 0.2.0" -> "~> 0.3.0"
3. Phase "Vastly Nice Impala"
 * sebex_test_d, 0.2.0 -> 0.3.0, publish
 dependencies: sebex_test_c, "~> 0.2.0" -> "~> 0.3.0"
 * sebex_test_f, 0.2.0 -> 0.3.0, publish
 dependencies:
 - sebex_test_c, "~> 0.2.0" -> "~> 0.3.0"
 - sebex_test_e, "~> 0.2.0" -> "~> 0.3.0"

Save this release? [y/N]:

The release plan will be saved inside the <workspace directory>/.sebex/release.yaml file. The release is divided into several phases. The subsequent phase can be launched, once the previous phase is finished, which is necessary due to dependencies between projects. In the first phase, we are releasing a new version of the listed projects. The later phase of the release comes with dependencies updates.

To execute the plan run:

sebex release proceed

for each phase of the plan. During the release, follow the instructions provided by sebex.

Elixir

At the moment Elixir is the only supported language.

Sebex will modify your Elixir projects by updating your project version and dependencies in the mix.exs file. Those changes will be committed to Github and tagged as a version release. To publish those updated packages to Hex you need to be logged in as an authorized Hex package maintainer on your machine.

You also need to set the HEX_API_KEY environment variable to your Hex user key. To generate the key run:

mix hex.user key generate

Only packages that were released at least once will be published automatically by Sebex to avoid publishing work-in-progress projects. However, packages belonging to the Github sebex-test-organization will always be published.

Development

We use Poetry to manage dependencies, virtual environments, and builds. Run poetry install to install all dependencies. To build wheels run make build.

Python tests are run using pytest, run pytest inside poetry shell to execute them. To run Elixir analyzer test, run mix test within its directory.

Support and questions

If you have any problems with Sebex or Membrane Framework feel free to contact us on the mailing list, Discord or via e-mail.

Copyright and License

Copyright 2020, Software Mansion

Software Mansion

Licensed under the Apache License, Version 2.0

sebex's People

Contributors

dependabot[bot] avatar maksstach avatar mat-hek avatar mickel8 avatar mkaput avatar varsill avatar wojciechbarczynski avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

sebex's Issues

Rewrite release planning logic

- in topological order incrementally respec all dependencies to highest available version instead of handling different bump cases individually
- bump minor version by one when dependencies change
- warn when an obsolete package is encountered (dependency version is not highest published nor planned for release)

Write tests for obsolete dependencies

test cases:

  • up to date dependency
  • obsolete dependency
  • dependency for higher version than highest released
  • source is alpha

write how to run poetry tests in readme

Support multiple release sources

As title says. Currently release planner and CLI do not support multiple sources. The groundwork is already present in ReleaseState

Sebex mass-patch

Add functionality to execute a script for each managed repository and open pull request if changes will be detected.

Releasing older versions

Currently Sebex only supports releasing new fresh version i.e. directly from master branch. It would be nice to support releasing fixes for versions older than latest one. Such process would not have to traverse whole dependency graph as we assume that our managed projects always target latest versions.

Publish sebex as single-file binary

Currently we recommend installing Sebex by cloning source and pip installing it. This is not the most ergonomic way. Ideally it would be great if the user would only have to download an executable binary, chmod it and run it. Ideally such binary should be created by pex or shiv, but this approach is currently blocked by the fact that our dependency, PyGithub, depends on wrapt package which is not multiversion wheel.

Implement sebex sync --push

The sync command currently supports only pulling changes from remotes. It should also allow to mass push code from managed repositories.

Ensure Sebex maintains version format

Sebex shouldn't add trailing zeros to version specs i.e. "~> 2.0" shouldn't be rewritten to "~> 2.0.0"

  • same for readme
  • warn if spec with one dot and a leading zero is encountered "~> 0.3" - it's dangerous because breaking changes can be silently introduces during deps.update if that format is used

sebex profile edit

Add a command to open current profile file in user's favourite text editor.

Bump versions at the moment of releasing

Instead of precomputing full release plan, it would be better to have Sebex only compute dependency graph, and then do version bumping at the very moment of submitting release PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.