Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

JENKINS-29637 - Ability to provide description for the task #138

Merged
merged 10 commits into from
Aug 18, 2015
Merged

JENKINS-29637 - Ability to provide description for the task #138

merged 10 commits into from
Aug 18, 2015

Conversation

dawidmalina
Copy link
Contributor

Additionally:

  • Move all task related classes to dedicated package: se.diabol.jenkins.pipeline.domain.task
  • Create TokenUtils to easily decode env with TokenMacro
  • Refactoring of a Task class to make it more simple to handle description and decoding env with TokenMacro and propose few private methods to remove code duplication

This change will handle this: JENKINS-20608 - Cannot use Env Var in Task Name

return TokenMacro.expandAll(build, TaskListener.NULL, template);
}
} catch (MacroEvaluationException e) {
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

printStackTrace directs output to the console and should be replaced with logger debugging

@dawidmalina
Copy link
Contributor Author

Fixed as you suggested.

@dawidmalina
Copy link
Contributor Author

When you can merge this?

@patbos
Copy link
Contributor

patbos commented Aug 4, 2015

@dawidmalina Im currently on vacation. I want to try out the changes.

@patbos
Copy link
Contributor

patbos commented Aug 4, 2015

I have tested the changes, nice work. Saw one issue. If I set a taskname to a macro that cant be expanded then the taskname will be an empty string, I think it is better to set some name in that case like the project name.

<img src="${resURL}/plugin/delivery-pipeline-plugin/help/description.png"/>
<p>
In a build Delivery Pipeline View this description will be shown as an description for the task. Description can be customized with all environment and <a href="http://ci.jenkins-ci.org/env-vars.html">build variables</a> using <a href="https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin">Token Macro Plugin</a>
</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add for example this:

<help xmlns="/lib/token-macro"/>

It will be replaced with a list of all macros available.

@dawidmalina
Copy link
Contributor Author

Will aply this tommorow 👍

@dawidmalina
Copy link
Contributor Author

Done


final String buildDescription = TokenUtils.decodedTemplate(build, resolveBuildDescription(build));
final String name = TokenUtils.decodedTemplate(build, this.getName());
final String taskName = (TokenUtils.stringIsNotEmpy(name) ? name : project.getName());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If decoded name will be empty or null we will use project name as fallback.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think fallback should be project.getDisplayName().

@dawidmalina
Copy link
Contributor Author

When this change will be merged?

@dawidmalina
Copy link
Contributor Author

When this can be merged?

@dawidmalina
Copy link
Contributor Author

I would be good to start merging. It will save lots of time with merge conflicts:) I see that you are changing Task class in other PR.

@tommysdk
Copy link
Contributor

Hi @dawidmalina! I've gone through the whole pull request and I think it looks good. However, I fail to see the actual description when I test the UI locally. Can you please clarify how it should be displayed (and possibly attach a screenshot) so I can troubleshoot (maybe I've just missed something obvious).

@dawidmalina
Copy link
Contributor Author

Templates are configured per build and if you click on help button you will see help message and screenshot like: src/main/webapp/help/description.png

@tommysdk
Copy link
Contributor

Thanks! I'll see if I can get it working locally. Should be good to merge after that!

tommysdk added a commit that referenced this pull request Aug 18, 2015
JENKINS-29637 - Ability to provide description for the task
@tommysdk tommysdk merged commit 4417405 into Diabol:master Aug 18, 2015
@dawidmalina dawidmalina deleted the description-template branch August 18, 2015 09:06
@tommysdk
Copy link
Contributor

Great job @dawidmalina! Thanks a lot for your contribution, keep it up!

openstack-gerrit pushed a commit to openstack-infra/jenkins-job-builder that referenced this pull request Dec 12, 2015
as documented in

    Diabol/delivery-pipeline-plugin#138

Change-Id: Ic6d7e54ea55c235deeb80240bb5c10e84bcff30d
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Dec 12, 2015
Project: openstack-infra/jenkins-job-builder  15e06f95869cb9ae3a7361a88a4ca10155b4d221

delivery-pipeline: support task description template

as documented in

    Diabol/delivery-pipeline-plugin#138

Change-Id: Ic6d7e54ea55c235deeb80240bb5c10e84bcff30d
mika pushed a commit to sipwise/jenkins-job-builder that referenced this pull request Apr 29, 2024
as documented in

    Diabol/delivery-pipeline-plugin#138

Change-Id: Ic6d7e54ea55c235deeb80240bb5c10e84bcff30d
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants