Advertisement
Guest User

Untitled

a guest
May 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. (() => {
  2.  
  3. const filterCommit = (text) => {
  4. if(text.startsWith('AR-') || text.startsWith('EMAC-') || text.startsWith('AFEM-')) {
  5. return text.split(':')[0];
  6. }
  7. };
  8.  
  9.  
  10. const discussionsCommits = [...document.querySelectorAll('.discussion-item-body a.message')];
  11. const commits = [...discussionsCommits].map(commit => {
  12. return filterCommit(commit.textContent)
  13. }).filter(x => x);
  14.  
  15.  
  16. const releaseCommits = [...document.querySelectorAll('.edit-comment-hide a')];
  17. const release = [...releaseCommits].map(commit => {
  18. return filterCommit(commit.textContent)
  19. }).filter(x => x);
  20.  
  21.  
  22. const diff = release.filter(value => !commits.includes(value));
  23. const diff2 = commits.filter(value => !release.includes(value));
  24.  
  25. if (diff.length > 0 || diff2.length > 0) {
  26. console.log('Issues:', `${diff.join(', ' )}, ${diff2.join(', ')}`);
  27. }
  28.  
  29. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement