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

Merge "Updated translations" commits function fails if a commit does not have an id #10445

Closed
pomek opened this issue Aug 30, 2021 · 0 comments · Fixed by ckeditor/ckeditor5-dev#723
Assignees
Labels
package:dev squad:platform Issue to be handled by the Platform team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@pomek
Copy link
Member

pomek commented Aug 30, 2021

📝 Provide detailed reproduction steps (if any)

When executing the generateChangelogForMonoRepository() function with additional private repositories, the private repository may contain a commit with updated translations (Updated translations.).

If merging such the commit, the function ends with an error because it doesn't check whether a link to the was added in the entry.

const newLine = line + ' ' + removedEntries.map( entry => {
	return entry.match( /(\(\[commit\].*)$/ )[ 1 ];
} ).join( ' ' );

✔️ Expected result

No error.

❌ Actual result

📍 Generating the changelog...
events.js:353
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property '1' of null
    at /Users/pomek/Projects/ckeditor/ckeditor5/node_modules/@ckeditor/ckeditor5-dev-env/lib/release-tools/utils/generatechangelog.js:111:45
    at Array.map (<anonymous>)
    at /Users/pomek/Projects/ckeditor/ckeditor5/node_modules/@ckeditor/ckeditor5-dev-env/lib/release-tools/utils/generatechangelog.js:110:47

❓ Possible solution

  • Check if match is not null.
  • Filter invalid items before mapping.
@pomek pomek added type:bug This issue reports a buggy (incorrect) behavior. squad:platform Issue to be handled by the Platform team. package:dev labels Aug 30, 2021
@pomek pomek added this to the iteration 47 milestone Aug 30, 2021
@pomek pomek self-assigned this Aug 30, 2021
psmyrek added a commit to ckeditor/ckeditor5-dev that referenced this issue Aug 30, 2021
Fix (env): The "generateChangelog()" util will not crash when merging "Updated translations." commits found in the private repositories. Closes ckeditor/ckeditor5#10445.
@pomek pomek changed the title The merge "Updated translations" commits function fails if a commit does not have id Merge "Updated translations" commits function fails if a commit does not have an id Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:dev squad:platform Issue to be handled by the Platform team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant