Giter Club home page Giter Club logo

ci-jobs-trigger's Introduction

ci-jobs-trigger

A Flask-based webhook server to trigger ci jobs.

Supported triggering flows:

Build and push container

  • Default image tag is latest, to use a different one set IMAGE_TAG=<tag>
  • Default image quay repository is quay.io/redhat_msi/ci-jobs-trigger, to use a different one set IMAGE_REPOSITORY=<repository>
make build
make push
  • To build and push custom tag and/or repository
IMAGE_TAG="test-image" IMAGE_REPOSITORY="quay.io/my-repo" make push

Development

Setup VirtualEnv

Use poetry to manage virtualenv.

pip install poetry

After installation, run:

poetry install

Execution

To run locally you can export the following environment variables:

poetry install

export FLASK_DEBUG=1  # Optional; to output flask logs to console.
export CI_JOBS_TRIGGER_LISTEN_PORT=5003  # Optional; to set a different port than 5000.
export CI_JOBS_TRIGGER_USE_RELOAD=1  # Optional; to re-load configuration when code is saved.
export CI_JOBS_TRIGGER_LISTEN_IP="0.0.0.0"  # Optional, to listen on all interfaces. Default is localhost only.

poetry run python  ci_jobs_trigger/app.py

Tests

Tests are located under tests dir

Check the code

Code checks tools that are defined in pre-commit-config To install pre-commit:

pip install pre-commit --user
pre-commit install

pre-commit will try to fix the error. If some error where fixed git add & git commit is needed again.

To run the tests and un-used code checks:

make tests

ci-jobs-trigger's People

Contributors

renovate[bot] avatar myakove avatar rnetser avatar pre-commit-ci[bot] avatar calebevans avatar chetna14manku avatar smatula avatar

Stargazers

 avatar

Watchers

Ronny Pfannschmidt avatar Ronelle Landy avatar Craig Donnelly avatar Sudhir avatar  avatar

ci-jobs-trigger's Issues

zstream only gets release info on initial load.

After initial load always getting already processed even though going to release page shows new version....

Only get parsing message on initial load. Looks like after first execution the function is not even entered... I think it has to do with @functools.cache. May need to remove from both parse_openshift_release_url() and get_accepted_cluster_versions():

zstream-trigger only finds new stable versions on initial load.

On 24 hour sleep next check is always already processed. Though there is a new accepted version and it is not in the already processed file. Its like the page is cached and not being updated.
If I delete the pod and the process restarts it will then find the new version and process.

zstream-trigger fails to process already_processed_version at times.

zstream-trigger.py function already_processed_version() uses subscript [0] to check against new version. When updating version no ordering is performed. Latest version may or may not be in subscript [0] of list. This can lead to running multiple times for the same version.

Could either update check to make sure new version is <= every version in list.

or

enhance update_processed_version() to sort list

from packaging.version import Version
processed_versions_file_content[base_version] = sorted(list(set(processed_versions_file_content[base_version])), key=Version, reverse=True)

Add support for trigger at desired cadence

Specifically for zstream, right now we plan to trigger once a month. We may increase the cadence in future.
We should have the option to specify the cadence in the config so it can be adjustable.

The stable releases for z-stream version happen typically once a week, unless it gets delayed or gets skipped for that week due to upcoming downtime.
The tool can check for new versions on first Monday of every month to get the latest version so far. Is is possible to do that currently?
Thanks

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.