Giter Club home page Giter Club logo

jenkinsplugins2nix's People

Contributors

anton-latukha avatar fuuzetsu avatar mayl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jenkinsplugins2nix's Issues

Manage package maintenance

Noticed that there isn't much happening in this respository for quite some time. The tool is still used by a couple of people though. I forked it a while ago and am willing to do some maintenance. (Mainly verison bumps, making it compile on recent versions of NixOS.) It would be nice to have this reflected on hackage. Any preferences on your side on how to manage this? (See https://wiki.haskell.org/Taking_over_a_package for a couple of options.)

Resolve based on Jenkins Version

This project has been mostly great to use, but there is a problem I almost always encounter when I re-build my Jenkins server. Normally I'd just open a PR but since I really don't know Haskell I thought I'd start here by outline the problem and what I've figured out about how to solve it.

Basically the issue is that the versions of Jenkins on Nixpkgs (even unstable) are rarely the most bleeding edge versions of Jenkins. If you then try and run all latest plugins from jenkinsPlugins2nix you hit incompatibilities which you have to manually resolve. Ideally, what I'd like to do is have a resolver strategy which of jenkins_version=<version_number>, which would install the most up to date versions of each plugin that is compatible with the version of Jenkins I'm building.

I've done a little research on how to do this and come across http://updates.jenkins.io/, which describes how Jenkins itself resolves plugin versions. In short, updates.jenkins.io/update-center.json?version=<jenkins_version_number> redirects to a JSON file of available plugins. Inside that file, there is a plugins key, which has under it a set of all the plugins. Each plugin includes a version key, and url key. The url key points directly to the hpi download for the latest plugin version supported by the version of Jenkins the update-center.json was downloaded for. If we modify jenkinsPlugins2nix to have a jenkins-version resolver strategy that selects plugins based on this file I think we could generate version which are exactly the same as Jenkins would do for itself.

Thoughts? Concerns? Again, I'll try and take a stab at this but I'm not really a Haskell developer so it'd be slow going for me...

Fails on `sshd` plugin

It seems that the sshd plugin does not have a URL field in the MANIFEST, which causes jenkinsPlugins2nix to fail. I don't know when this happened, but it seems to have been applied to all the published versions I checked. This is an issue for the tool, since sshd is a pretty ubiquitous dependency throughout Jenkins plugins.

I don't know Haskell, but perhaps this parser parameter needs to be optional?

Build problem (perhaps because I'm newbie)

Hi, I tried to build the project and got this:

$ git clone https://github.com/Fuuzetsu/jenkinsPlugins2nix.git
$ cd jenkinsPlugins2nix
$ stack build

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for hnix-0.3.4:
    data-fix-0.0.4 must match >=0.0.7 (latest applicable is 0.2.0)
needed due to jenkinsPlugins2nix-0.2.0.2 -> hnix-0.3.4

Plan construction failed.

This is on NixOS 17.03. Any easy fix? For now I'm using nix-build -A haskellPackages.jenkinsPlugins2nix, which works, but I'd like to try hacking too :-)

Broken in nixpkgs

$ nix-shell -p haskellPackages.jenkinsPlugins2nix
error: Package ‘jenkinsPlugins2nix-0.5.0.0’ in /nix/store/al476r5q8bifinbrysh37yzm7mbryxvd-nixpkgs/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix:165065 is marked as broken, refusing to evaluate.

       a) To temporarily allow broken packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_BROKEN=1

        Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowBroken = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowBroken = true; }
       to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)

This is due to the upper bounds on attoparsec and tasty. Trying to build with NIXPKGS_ALLOW_BROKEN=1 results in

Configuring jenkinsPlugins2nix-0.5.0.0...

Setup: Encountered missing or private dependencies:
attoparsec >=0.13 && <0.14, tasty-hspec >=1.1 && <1.2

However, just bumping the upper bound is not enough, as it results in another error in the test suite:

test/Nix/JenkinsPlugins2Nix/Tests/Parser.hs:16:9: error:
    Not in scope: type constructor or class ‘Hspec.Spec’
    Module ‘Test.Tasty.Hspec’ does not export ‘Spec’.
   |
16 | spec :: Hspec.Spec
   |         ^^^^^^^^^^

test/Nix/JenkinsPlugins2Nix/Tests/Parser.hs:17:8: error:
    Not in scope: ‘Hspec.describe’
    Module ‘Test.Tasty.Hspec’ does not export ‘describe’.
   |
17 | spec = Hspec.describe "parser spec" $ do
   |        ^^^^^^^^^^^^^^

test/Nix/JenkinsPlugins2Nix/Tests/Parser.hs:18:3: error:
    Not in scope: ‘Hspec.it’
    Module ‘Test.Tasty.Hspec’ does not export ‘it’.
   |
18 |   Hspec.it "parser github-pullrequest manifest" githubPr
   |   ^^^^^^^^

test/Nix/JenkinsPlugins2Nix/Tests/Parser.hs:20:13: error:
    Not in scope: type constructor or class ‘Hspec.Expectation’
    Module ‘Test.Tasty.Hspec’ does not export ‘Expectation’.
   |
20 | githubPr :: Hspec.Expectation
   |             ^^^^^^^^^^^^^^^^^

test/Nix/JenkinsPlugins2Nix/Tests/Parser.hs:21:27: error:
    Not in scope: ‘Hspec.shouldBe’
    Module ‘Test.Tasty.Hspec’ does not export ‘shouldBe’.
   |
21 | githubPr = Right expected `Hspec.shouldBe` runParseManifest githubPrManifestText
   |                           ^^^^^^^^^^^^^^^^

Compilation fails on NixOS 18.09

Just upgraded to NixOS 18.09 and wanted to add jenkinsPlugins2nix to the system packages. Compilation fails with the following output:

[3 of 3] Compiling Nix.JenkinsPlugins2Nix ( src/Nix/JenkinsPlugins2Nix.hs, dist/build/Nix/JenkinsPlugins2Nix.o )

src/Nix/JenkinsPlugins2Nix.hs:123:15: error:
    Not in scope: ‘Nix.mkApp’
    Perhaps you meant one of these:
      data constructor ‘Nix.NApp’ (imported from Nix.Expr),
      ‘Nix._NApp’ (imported from Nix.Expr),
      ‘Nix.nApp’ (imported from Nix.Expr)
    Neither ‘Nix.Expr’ nor ‘Nix.Pretty’ exports ‘mkApp’.
    |
123 |               Nix.mkApp (Nix.mkSym "stdenv.mkDerivation") $ Nix.mkNonRecSet
    |               ^^^^^^^^^

src/Nix/JenkinsPlugins2Nix.hs:135:18: error:
    Not in scope: ‘Nix.mkApp’
    Perhaps you meant one of these:
      data constructor ‘Nix.NApp’ (imported from Nix.Expr),
      ‘Nix._NApp’ (imported from Nix.Expr),
      ‘Nix.nApp’ (imported from Nix.Expr)
    Neither ‘Nix.Expr’ nor ‘Nix.Pretty’ exports ‘mkApp’.
    |
135 |     fetchurl p = Nix.mkApp (Nix.mkSym "fetchurl") $
    |                  ^^^^^^^^^

src/Nix/JenkinsPlugins2Nix.hs:136:38: error:
    Not in scope: ‘Nix.mkUri’
    Neither ‘Nix.Expr’ nor ‘Nix.Pretty’ exports ‘mkUri’.
    |
136 |       Nix.mkNonRecSet [ "url" Nix.$= Nix.mkUri (download_url p)
    |                                      ^^^^^^^^^

src/Nix/JenkinsPlugins2Nix.hs:141:16: error:
    Not in scope: ‘Nix.mkApp’
    Perhaps you meant one of these:
      data constructor ‘Nix.NApp’ (imported from Nix.Expr),
      ‘Nix._NApp’ (imported from Nix.Expr),
      ‘Nix.nApp’ (imported from Nix.Expr)
    Neither ‘Nix.Expr’ nor ‘Nix.Pretty’ exports ‘mkApp’.
    |
141 |     mkBody p = Nix.mkApp (Nix.mkSym "mkJenkinsPlugin") $
    |                ^^^^^^^^^
builder for '/nix/store/xf61qhh05z5km0crkd52wkbw642nh22p-jenkinsPlugins2nix-0.2.0.2.drv' failed with exit code 1

Looks like some incompatibility with a newer version of hnix.

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.