Qqwy

Qqwy

TypeCheck Core Team

Blocked - Keep track of when hotfixes can be removed

Blocked is a tiny Elixir-library that helps you to keep track of when hotfixes can be removed by showing compile-time warnings when issues (in your project repository or any other source-code GitHub repository) are closed.

hex.pm version Build Status Documentation


Blocked was made to improve the quality of your project’s code over time: It automates away the human task of checking whether certain hot-fixes, ‘temporary patches’ or ‘duct-tape code’ are still required.
This makes it less scary to add a temporary workaround to your codebase, because you’ll know the minute it is no longer necessary!

Basic features:

  • Runs at compile-time as a macro.
  • Prints a compile-time warning any time an issue is closed that a piece of your code was waiting for.
  • Works for your own project issues as well as for issues of any other GitHub-hosted repository.
  • Allows specifying both ‘hotfix’ and optionally a ‘desired’ code block, to make it clear to future readers of your code what can be changed once the related issue is closed.
  • Configurable to work on private repositories as well.
  • By default performs only checking in Continuous Integration, to keep local compilation fast.

Simple usage example

defmodule Example do
  require Blocked

  def main do
    IO.puts("Hello, world!")
    Blocked.by("#42", "This code can be removed when the issue is closed") do
      hacky_workaround()
    end
    
    # The reason is optional
    Blocked.by("#69") do
      a_quick_fix()
    end
    
    # It is possible to indicate
    # the desired 'ideal' code as well, by passing an `else` block:
    Blocked.by("#1337") do
      ugly_fallback()
    else
      beautiful_progress()
    end
    
    # If the blockage is more general, you can also leave out the `do` block.
    Blocked.by("#65535", "This whole module can be rewritten once we're on the new Elixir version!")
    
    # Blocked supports many ways of referring to an issue
    Blocked.by("#13")
    Blocked.by("elixir#13")
    Blocked.by("elixir/13")
    Blocked.by("elixir-lang/elixir#13")
    Blocked.by("elixir-lang/elixir/13")
    Blocked.by("https://github.com/elixir-lang/elixir/issues/13")
  end
end

Supported Issue Reference patterns

  1. 123 or #123: issue number. Assumes that the isue is part of the current repository.
  2. reponame/123 or reponame#123: repository + issue number. Assumes that the repository is part of the same owner/organization as the current repository.
  3. owner/reponame/123 or owner/reponame#123: owner/organization name + repository + issue number.
  4. https://github.com/owner/reponame/issues/123: Full-blown URL to the page of the issue.

Automatic Repository Detection

We use the git remote get-url command to check for the remote URL of the current repository and attempt to extract the owner/organization and repository name from that.
We check against the upstream remote (useful in a forked project), and the origin remote.

If your setup is different, you can configure the repository and owner name by specifying custom settings in the Blocked.Config.

Most Liked

Qqwy

Qqwy

TypeCheck Core Team

Version 0.10 is now released.
Earlier versions dependend on TentaCat, which is a great GitHub-API-client but it has many (transient) dependencies.
To keep Blocked light enough to add to any project, this has been changed to manually calling the GitHub-API using Tesla backed by Mint.

This change has reduced the number of (transient) dependencies from 15 to 5 :smiley: .

Qqwy

Qqwy

TypeCheck Core Team

Some extra bugfixing has been done; version 0.9.1 is now released!

OvermindDL1

OvermindDL1

Ooo, I quite like the idea of this, and the interface looks wonderful!

Where Next?

Popular in Announcing Top

Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps w...
New
mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44532 311
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New

Other popular topics Top

ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement