httpRequest no longer compatible; and a question to the maintainers

78 views
Skip to first unread message

Penguat

unread,
Jan 7, 2017, 2:19:01 PM1/7/17
to job-dsl-plugin
Hi, where I work we've just started using JobDSL recently, as we got to the point where we really needed to configure our Jenkins instance using code, and we've run into so many issues trying to configure httpRequest that we've used a configure block instead. In particular, httpRequest failed due to the lack of contentType, acceptType and consoleLogResponseBody in the job configuration.

Would you appreciate a patch to update these?
We're also using a configure block to handle VSTest.console; would you be prepared to accept support as a patch, or should I look to the maintainers of that plugin instead to add support?

Thanks,
Alex

Daniel Spilker

unread,
Jan 7, 2017, 4:05:25 PM1/7/17
to job-dsl...@googlegroups.com
Hi!

It's easy for a plugin to retain backwards compatibility. Apparently the HTTP Request plugin maintainer did not follow the instructions on the wiki: https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility. The current version does not seem to support the returnCodeBuildRelevant option. But there is an alias for logResponseBody to consoleLogResponseBody, so that should still work.

You can use the Automatically Generated DSL (https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL), which supports all options:

job('example') {
  steps {
    httpRequest {
      url('foo')
      acceptType('APPLICATION_JSON')
      contentType('TEXT_PLAIN')
      consoleLogResponseBody(true)
    }
  }
}


Unfortunately the embedded API Viewer does not show these methods. But I'll fix that. And then I'll deprecate built-in support for the HTTP Request plugin, so you do not need to send a patch.

The Automatically Generated DSL supports the VsTestRunner plugin, so you do not need to send a patch for that either:

job(String name) {
  steps {
    vsTestBuilder {
      vsTestName(String value)
      // Specify the path to your VSTest compiled assemblies.
      testFiles(String value)
      // Run tests with additional settings such as data collectors.
      settings(String value)
      // Run tests with names that match the provided values.
      tests(String value)
      // Run tests that match the given expression.
      testCaseFilter(String value)
      // Enables data diagnostic adapter CodeCoverage in the test run.
      enablecodecoverage(boolean value)
      // Runs the tests in an isolated process.
      inIsolation(boolean value)
      // This makes vstest.console.exe process use or skip the VSIX extensions installed (if any) in the test run.
      useVsixExtensions(boolean value)
      // Target platform architecture to be used for test execution.
      platform(String value)
      otherPlatform(String value)
      // Target .NET Framework version to be used for test execution.
      framework(String value)
      otherFramework(String value)
      // Specify a logger for test results.
      logger(String value)
      otherLogger(String value)
      cmdLineArgs(String value)
      failBuild(boolean value)
    }
  }
}

Regards,
Daniel

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/1903c371-8548-49c7-8767-f2c3374f4d57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Spilker

unread,
Jan 11, 2017, 4:01:13 AM1/11/17
to job-dsl...@googlegroups.com
Job DSL 1.57 will show all available signatures.

https://github.com/jenkinsci/job-dsl-plugin/pull/982

Daniel

To post to this group, send email to job-dsl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages