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

[ACS-5400] Fix incomplete string escaping #8721

Conversation

nikita-web-ua
Copy link
Contributor

@nikita-web-ua nikita-web-ua commented Jun 29, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)

https://alfresco.atlassian.net/browse/ACS-5400

What is the new behaviour?

Fixed incomplete string escaping

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@nikita-web-ua nikita-web-ua marked this pull request as ready for review June 29, 2023 12:27
@@ -109,7 +109,7 @@ function getCommits(options: DiffOptions): Array<Commit> {
let log = shell.exec(command, { cwd: options.dir, silent: true }).toString();

// https://stackoverflow.com/a/13928240/14644447
log = log.trim().replace(/"/gm, '\\"').replace(/\^@\^/gm, '"');
log = JSON.stringify(log.trim()).slice(1, -1).replace(/\^@\^/gm, '"');
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm not sure it is going to work as log is not an object so you can't stringify it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

log is a string, we use JSON.stringity to escape the quotes

Copy link
Contributor

Choose a reason for hiding this comment

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

did you test the changelog command? does it produce the expected output?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a fix, now works as expected

@nikita-web-ua nikita-web-ua force-pushed the dev-mmaliarchuk/ACS-5400-Incomplete-string-escaping-or-encoding branch from 29d3e71 to d295e82 Compare July 20, 2023 12:18
@sonarcloud
Copy link

sonarcloud bot commented Jul 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@DenysVuika DenysVuika merged commit 3125628 into develop Jul 29, 2023
33 checks passed
@DenysVuika DenysVuika deleted the dev-mmaliarchuk/ACS-5400-Incomplete-string-escaping-or-encoding branch July 29, 2023 18:34
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.

5 participants