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 Libraries Top

kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
Crowdhailer
The latest release of Ace (0.10.0) includes serving content over HTTP/2. I have started writing a webserver to teach my self more about...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
benlime
LiveMotion enables high performance animations declared on the server and run on the client. As a follow up to my previous thread A libr...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
Eiji
ExApi is a library that I’m developing now and hope release soon This library will allow to: list all apis list all api implementation...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
versilov
Could not wait for the missing Elixir ML libraries to appear, so, I wrote one myself, taking https://github.com/sdwolfz/exlearn as a foun...
New

Other popular topics Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New

Sub Categories:

We're in Beta

About us Mission Statement