Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for frontend integration + opt-in for Jenkins integration #1016

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

timja
Copy link
Member

@timja timja commented Sep 23, 2024

Fixes #874

Restores the ability to use Jenkins to report test failures (broken in #1008) and implements support for linting.

See also discussion in #1015 (comment) where it was decided that the restoring of the support will be opt-in to ensure that by default plugins builds will not silently fail on frontend test / lint failures.

Testing done

Tested with a local SNAPSHOT in jenkinsci/workflow-cps-plugin#935

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@timja timja marked this pull request as ready for review September 23, 2024 08:30
@timja timja requested review from basil and jglick September 23, 2024 08:32
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Sounds OK. Is there a quick way to determine whether a given repo contains relevant tests, like a test -d something? Are there any other @jenkinsci plugins misconfigured? (There might be some @cloudbees plugins affected, so it would be nice to have a simple thing to search for in GitHub.)

@timja
Copy link
Member Author

timja commented Sep 23, 2024

Sounds OK. Is there a quick way to determine whether a given repo contains relevant tests, like a test -d something? Are there any other @jenkinsci plugins misconfigured? (There might be some @cloudbees plugins affected, so it would be nice to have a simple thing to search for in GitHub.)

This search brings up the plugins that could be affected:
https://github.com/search?q=org%3Ajenkinsci%20mvntest&type=code

Not sure of an easy way to tell if misconfigured as you can configure it in multiple different ways.
e.g. at first glance I thought this was misconfigured:
https://github.com/jenkinsci/active-choices-plugin/blob/6736e8c22d18cadd5635410589522cd85c2be333/package.json#L12

but if you look further down you'll see its been configured a different way:
https://github.com/jenkinsci/active-choices-plugin/blob/6736e8c22d18cadd5635410589522cd85c2be333/package.json#L44-L67

@timja
Copy link
Member Author

timja commented Sep 23, 2024

Looking through the list further I saw a few categories:

  1. empty string or exit 0 defined for mvntest
  2. jest with junit-jest setup
  3. jjsbuilder
  4. gulp
  5. eslint - these are mostly misconfigured
    1. e.g. https://github.com/jenkinsci/workflow-cps-plugin/blob/0767b4ba0bfaff516d26190f151676b116cc6e61/plugin/package.json#L14
    2. https://github.com/jenkinsci/job-dsl-plugin/blob/616477fe247803b7d45f8be2d2e54b5f84ee0450/job-dsl-plugin/package.json#L8

For eslint there's an example in Jenkins core using the checkstyle format: https://github.com/jenkinsci/jenkins/blob/master/package.json#L18

I suspect anything using jjsbuilder or gulp will not be configured right and is likely unmaintained / very old.

@timja timja marked this pull request as draft September 23, 2024 14:51
@timja
Copy link
Member Author

timja commented Sep 23, 2024

I'll add an eslint example before taking this out of draft and add it to workflow-cps

@timja timja changed the title Add docs for frontend integration Add docs for frontend integration + opt-in for Jenkins integration Sep 23, 2024
@timja timja marked this pull request as ready for review September 23, 2024 21:31
@timja timja requested review from basil and removed request for basil September 24, 2024 07:53
README.md Outdated
Comment on lines 226 to 234
<!-- TODO when enough plugins have adopted this then remove this step -->
Then set the following properties in your `pom.xml` to configure the Maven build to let Jenkins report the results:

```xml
<properties>
<maven.test.failure.ignore>false</maven.test.failure.ignore>
<testFailureIgnore>${maven.test.failure.ignore}</testFailureIgnore>
</properties>
```
Copy link
Member

Choose a reason for hiding this comment

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

pom.xml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
@timja timja merged commit d9a86c4 into jenkinsci:master Oct 3, 2024
2 checks passed
@timja timja deleted the frontend-integration branch October 3, 2024 19:08
hashar added a commit to hashar/plugin-pom that referenced this pull request Oct 21, 2024
The documentation for the marker files missed the leading dot.

They were introduced by jenkinsci#1016.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yarn mvntest failures ignored in CI
3 participants