Code Monkey home page Code Monkey logo

sync-branches's Introduction

Go Reference

Gravwell Open-Source Code

This repository contains open-sourced libraries and commands developed by Gravwell.

There are a selection of Gravwell-specific libraries and tools:

  • ingest/ contains the ingest library, which is used to connect to a Gravwell indexer and upload data.
  • ingesters/ contains the source code for Gravwell ingesters.
  • generators/ is a collection of tools that generate artificial data for testing Gravwell or any other log analytics system.
  • manager/ provides a very simple init command which we use in Docker containers.
  • chancacher/ implements a caching library we use for ingesters.

There are also a few libraries which may be of use outside Gravwell-specific applications:

  • filewatch/ is a library that can monitor files on the filesystem for changes; we use this in the FileFollow ingester.
  • timegrinder/ is a timestamp extraction library we use to extract timestamps from arbitrary data
  • ipexist/ contains a library for efficiently storing and checking for the existence of an IPv4 set with high density sets.
  • winevent/ is a library which can interact with the Windows Event subsystem to extract XML rendered events.

sync-branches's People

Contributors

ashnwade avatar michael-wisely-gravwell avatar

sync-branches's Issues

Visibility: Improve visibility of conflicts

Enhancement

What is the enhancement to be made?

When opening a sync PR, if there is a conflict between an intermediate branch and the base/target branch, open the PR anyway.

Why should we make this change? (Business justification? What problem is the feature trying to solve?)

One major benefit of sync-branches is that it makes the sync status of branches visible. Developers can see that a branch is behind because there's an open PR to bring it up to date.

Currently, when using an intermediate branch, sync-branches will fail to open a PR if it's unable to merge source into target. That means that unless users are diligently watching Actions outcomes, a conflict between source and target can be very easily overlooked.

A Concrete Example

Let's say we have branches STABLE and CURRENT and we have sync-branches configured like so...

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: gravwell/sync-branches@v1
        with:
          GITHUB_TOKEN: ${{ github.token }}
          PR_CREATE_TOKEN: ${{ secrets.MY_PAT }}
          use_intermediate_branch: true
          source_pattern: STABLE
          target_pattern: CURRENT

What we're doing now

  • STABLE receives an update
  • sync-branches creates an intermediate branch merge/STABLE_to_CURRENT based on CURRENT
  • sync-branches attempts to merge STABLE into merge/STABLE_to_CURRENT
  • There's a conflict ๐Ÿ˜ฑ
  • Action Fail

Outcome: Action has failed, no PR.

What this Enhancement proposes we should do instead

  • STABLE receives an update
  • sync-brances creates an intermediate branch merge/STABLE_to_CURRENT based on STABLE
  • sync-branches attempts to merge CURRENT into merge/STABLE_to_CURRENT
  • There's a conflict ๐Ÿ˜ฑ
  • sync-branches logs message about the conflict
  • sync-branches opens a PR from merge/STABLE_to_CURRENTto CURRENT
  • sync-branches adds a comment to the new PR about the conflict it encountered.
  • Action success

Outcome: An open PR shows there's a conflcit. User has to merge CURRENT into merge/STABLE_to_CURRENT themselves

Any other comments?

sync-branches should comment on a PR any time it fails to merge. It's totally possible to have a conflict on a source=>intermediate merge. Those should be reported, too.

CI: Avoid close+open CI kick if the PR hasn't actually changed

Enhancement

What is the enhancement to be made?

Avoid the close+open CI kick if the PR hasn't changed.

Why should we make this change? (Business justification? What problem is the feature trying to solve?)

No need to tie up runners or waste minutes if nothing's different on the PR.

Any other comments?

Workflow use: Add output(s) with info about created (?) branches / PRs

Enhancement

What is the enhancement to be made?

Use core.setOutput() to set outputs available to future workflows

Why should we make this change? (Business justification? What problem is the feature trying to solve?)

When using sync-branches in a workflow, there are situations where it would be useful to know...

  • Did we open a PR?
  • If we opened a PR, what's its head branch? What's its base branch? What are the shas of those branches?

Any other comments?

Some things we could set...

For each PR affected by a run of sync-branches...

  • The name of the source branch
  • The name of the target branch
  • The URL of the PR
  • The head of the PR (since we might be using an intermediate branch)
  • The base of the PR (same as target)

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.