-1.3 C
New York
Monday, January 15, 2024

Reside Coding Conversion of GitHub Motion Tremendous-Linter to GitLab CI

In the newest Mission Not possible Reside Coding occasion, Jefferson and I convert the GitHub Motion Tremendous-Linter to run in GitLab CI. This can be a abstract of classes discovered and tips to the outcomes.

So Jefferson and I labored by this method. Earlier than the session I performed with some concepts and approaches, however finally we ended up with a brand new method.

Classes Discovered:

  • GitLab has linting as part of it’s built-in Code High quality scanning:
    • However it may be a problem to determine that that is the place GitLab CI does linting – it’s a must to dig into the web site of the underlying software program “Code Local weather” to determine that that is being carried out and for what languages.
    • GitLab’s built-in help is configurable, together with including your individual Code High quality scanning jobs with further merchandise.
  • Tremendous-Linter has a number of language protection.
  • Tremendous-Linter is applied in a container – this implies implementation on GitLab CI needs to be even simpler – particularly if the picture constructed for it’s publicly out there. If the picture was not publicly out there, we might have constructed the docker file on GitLab as a prerequiste to utilizing it in GitLab CI.
  • Tremendous-Linter is pushed by a number of variables – very appropriate with GitLab CI.
  • Tremendous-Linter has a particular parameter, RUN_LOCAL, that overrides a bunch of anticipated GitHub Actions enter parameters – so we don’t must emulate or map these anticipated parameters. Maybe many GitHub Actions will be repurposed simply utilizing this parameter.
  • Tremendous-Linter solely outputs outcomes to the log – not as an artifact file. Hopefully because it matures it will likely be in a position to emit check outcomes. If it might emit JUNIT.xml we might have loaded the outcomes into GitLab’s check outcomes visualization panels. If we might rework the outcomes into GitLab Code High quality outcome format, outcomes may very well be much more deeply built-in inline into Merge Requests.

Strategies Demonstrated:

  • Examing the supply code and documentation for clues on the way to implement Tremendous-Linter outdoors of GitHub.]
  • Iteration – Let GitLab CI “give it a shot” whereas we analysis different issues.
  • Transferring variable declarations round to make sure they’re encountered early sufficient (a ultimate break by by Jefferson was to maneuver a key variable declaration from the script into GitLab’s variables: block)
  • Make Right into a Plug-in Extension by:
    • Reimplementing the dwell code in a approach that allows it to be merely included in different CI.
    • Present an instance of calling the plug-in.
    • Reveal the way to model peg the plug-in utilizing GitLab’s embrace:ref: to level to a particular git tag of the plugin.

The Code


Mission Not possible Reside Coding

The previous recordings, together with the above are at: https://www.youtube.com/channel/UCcL7kaon80MiwuGcNI7A1Dg

We’re dwell coding each two weeks on Friday at 2pm ET – the following one will likely be on July third.

You may add it to your calendar with this .ICS file.

The dwell stream will is at: https://www.twitch.television/missionimpossiblecode and https://www.youtube.com/channel/UCcL7kaon80MiwuGcNI7A1Dg.

We will likely be utilizing GitLab points to queue up questions and allow you to submit code snippets for consideration. Please use this GitLab challenge for that goal: https://gitlab.com/missionimpossiblecode/dwell/-/points

Supply hyperlink

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles