-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: sanitizeMarkdown on packageName & prTitle #8795
Conversation
Please create an issue to discuss the problem and possible solutions first. The solution you propose is now resulting in some double escaping, which is not ideal. |
@ThibautMarechal Can you rebase your branch onto latest |
lib/workers/pr/body/index.spec.ts
Outdated
|
||
import { getPrBody } from '.'; | ||
|
||
describe('workers/pr/body', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe('workers/pr/body', () => { | |
describe(getName(), () => { |
lib/workers/pr/body/index.spec.ts
Outdated
@@ -0,0 +1,41 @@ | |||
import { platform } from '../../../../test/util'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { platform } from '../../../../test/util'; | |
import { getName, platform } from '../../../../test/util'; |
lib/workers/pr/body/index.spec.ts
Outdated
jest.mock('./config-description', () => ({ | ||
getPrConfigDescription: jest.fn(() => ''), | ||
})); | ||
jest.mock('./controls', () => ({ | ||
getControls: jest.fn(() => ''), | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jest.mock('./config-description', () => ({ | |
getPrConfigDescription: jest.fn(() => ''), | |
})); | |
jest.mock('./controls', () => ({ | |
getControls: jest.fn(() => ''), | |
})); | |
jest.mock('./config-description'); | |
jest.mock('./controls'); |
just use default mocks jests will do it's magic 🧙
lib/workers/pr/body/index.spec.ts
Outdated
let config: RenovateConfig; | ||
beforeEach(() => { | ||
config = getConfig(); | ||
platform.massageMarkdown = jest.fn((input) => input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
platform.massageMarkdown = jest.fn((input) => input); | |
platform.massageMarkdown.mockImplementation((input) => input); |
platform.massageMarkdown
is already a mock 😉
Snapshots need to be updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs running on a real repo to sanity check it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs running on a real repo to sanity check it
This still applies |
@ThibautMarechal were you able to verify this on one or more public repos? |
Changes:
Use sanitizeMarkdown for PrTitle & PackageName in the update table & onboarding pr-list.
Context:
I have a weird behavior using the platform bitbucket-server. Adding the zero-width character after the '@' fixed the issue.
it display '@testing/react-autosuggest' but the real packageName is '@type/react-autosuggest'.
(@ testing is coming from the package above)
It only hapend when the packageName is in a link.
It's now fixed by the sanitizeMarkdown function.
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: