Git Product home page Git Product logo

Comments (4)

elvanja avatar elvanja commented on September 23, 2024

Hi @jakea, I've checked your findings and you're partially right.

Here is a view of such message rendered on a specific build / job page:
gitlab_hook_message_rendering_on_job_overview
As you can see, the HTML is properly rendered.

But, here is a view of the same information, but rendered on mouse over the git icon next to the build link:
gitlab_hook_message_rendering_on_project_overview
Here the message is not HTML parsed. I checked the page source and this text is actually a title tag of an image, I suppose used to render the overlay.

This plugin just prepares HTML content that describes the build. It is up to the rest of the Jenkins ecosystem to render it appropriately. Hence, this is better reported to either Jenkins core or maybe Git plugin itself.

from jenkins-gitlab-hook-plugin.

 avatar commented on September 23, 2024

Are you using the latest Jenkins? If not, what theme are you using for your Jenkins? On default and a separate theme both, it only shows the HTML.

from jenkins-gitlab-hook-plugin.

 avatar commented on September 23, 2024

I see that text is in a tag. Is this necessary? I feel like that is what is keeping the page from parsing the HTML. (Or is that, as you said, git plugin's problem?)

from jenkins-gitlab-hook-plugin.

elvanja avatar elvanja commented on September 23, 2024

This is the setup I currently run:

  • Jenkins v1.573
  • Gitlab Hook plugin v1.1.0
  • Git plugin v2.2.2
  • Stock theme (Simple Theme plugin is installed but no actual theme is applied)

The HTML for specific build / job page is:

<span>Started by remote host git.acme.local with note:<br>
<br>
triggered by push on branch refs/heads/master<br>
with 1 commit:<br>
* <a href="http://git.acme.local/projects/ACME/repos/acme/commits/cd1233b6...">Merge remote-tracking branch 'origin/test' into master</a><br>
</span>

And this renders OK. I guess lists could use ul/li instead of * but it doesn't change the fact that it is rendered OK.

The HTML for mouse over on build is a bit different. Don't have the example here but essentially the above HTML is put into a tiitle part of the <a>... link for that icon. Whatever plugin is rendering the overlay should be updated to render HTML instead of just plain text.

One more thing. This plugin has nothing to do with rendering these messages. It is only responsible for generating it. You can see https://github.com/elvanja/jenkins-gitlab-hook-plugin/blob/master/models/use_cases/build_now.rb#L29 for details. This is where this plugin triggers the build and passes in the message it generates in https://github.com/elvanja/jenkins-gitlab-hook-plugin/blob/master/models/services/get_build_cause.rb. After that, Jenkins takes over and performs the build, renders the details on job / build page(s) and essentially uses this generated message. Whatever I put in that generated message attached to the build, I can not influence it's rendering anywhere on Jenkins. As I said, you'll have contact someone responsible for rendering, and I suppose it can be the core Jenkins team or Git plugin team (guessing).

from jenkins-gitlab-hook-plugin.

Related Issues (20)

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.