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

OSOE-545: Automatically assign GitHub issue corresponding to a pull requests based on Jira issue key in Lombiq.GitHub.Actions #197

Merged
merged 49 commits into from
Feb 15, 2023

Conversation

dorraj07
Copy link
Contributor

@dorraj07 dorraj07 commented Feb 3, 2023

OSOE-545
Fixes #189

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

@check-spelling-bot Report

🔴 Please review

See the 📂 files view or the 📜action log for details.

Unrecognized words (1)

OSOE

Previously acknowledged words that are now absent abcdef abcdefghijklmnopqrstuvwxyz amet Argb autoinit bak baz Bcc blog btn Bubl buble CDNs certs chainable chartjs chmod chown Chro chromedriver cjs Cloudflare Cms cref crlf ctor ctx cwd dba DBs dddd dest Dsc EACCES ecma editorconfig emails Embedd enableextensions esm EULA eur falsey favicon ffff Fhd fixme GDPR Graphi HHmmss hsva https Hvga icbin idx iife iis ipsum itemprop JMES json jsoneditor jsoneditoronline KUhd labelledby lastgremlinsclick linebreak linkedin linux localhost lockfile lombiqdt lookbehind markdownlint mcr mde mixin mkdir MMM mogwais Moq msbuild mscorlib msedgedriver mso MVVM myapp navbar Nhd NLog Noda nologo NONINFRINGEMENT NPM npx NTFS NVARCHAR omnisharp onspecial onwarn orchardcore osoce parallelizable pickr PII plusplus pnpm popstate postclean Postgre pragma prebuild preheader publishsettings pwd pwsh Qhd Qvga Qwxga readdir Regexes Rekt RHEL RSPEC sdk setlocal SFCs shortcode sln sme Smo sourced sourcemaps sql sqlcmd sudoing SUSE Svga Sxga testid Tful thetheme todo tundora Tzdb uri urijs userspace utf Uwqhd Vga vuejs vuelidate wcag webapp wiki wpf Wqhd Wsxga Wuxga wwwroot Wxga Wysiwyg XDG Xga XPATH xsessionrc XSRF xunit xxl yaml Yarp yml yyyy :arrow_right:
To accept ✔️ these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the git@github.com:Lombiq/GitHub-Actions.git repository
on the dev branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/Lombiq/GitHub-Actions/dev/apply.pl' |
perl - 'https://github.com/Lombiq/GitHub-Actions/actions/runs/4084306400/attempts/1'
Available 📚 dictionaries could cover words not in the 📘 dictionary

This includes both expected items (180) from .github/actions/spelling/expect.txt and unrecognized words (1)

Dictionary Entries Covers
cspell:software-terms/src/software-terms.txt 1237 3
cspell:software-terms/src/software-tools.txt 60 1
cspell:node/src/node-old.txt 730 1
cspell:node/node.txt 1768 1
cspell:cpp/src/people.txt 23 1

Consider adding them using (in .github/workflows/spelling-this-repo.yml):

      with:
        extra_dictionaries:
          cspell:software-terms/src/software-terms.txt
          cspell:software-terms/src/software-tools.txt
          cspell:node/src/node-old.txt
          cspell:node/node.txt
          cspell:cpp/src/people.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''

Spell checking configuration advices

Basics

Since this action is an extension of check-spelling, make sure that you familiarize yourself with its concepts and configuration options first. Some of the most notable ones:

  • The spell checking process replaces matched words with a space character and built-in configuration files are checked first.
  • The order of entries within a configuration file matters.

Configuration files

Configuration files allow you to define words and patterns that shouldn't be considered spelling mistakes, e.g.:

  • allow.txt: Normal, expected words that just simply weren't added to the base or other referenced dictionary files yet.
  • excludes.txt: Perl-style regexes to ignore specific paths, files or extensions.
  • expect.txt: Dictionary file of arbitrary strings that aren't words, but otherwise valid and aren't spelling mistakes.
  • patterns.txt: Technical strings that aren't made up of words or word stems but follow a certain structure or pattern can be skipped using Perl-styled regexes. Some technical strings are already covered in Lombiq's version, such as hex color codes, Git commit hashes, GUIDs, and more.

You can provide these files in your own repository, but they must be placed under the path .github/actions/spelling. To ease maintaining dictionary files (and keep a consistent behavior), keep the entries sorted alphabetically.

When not to add entries to dictionary files

Before adding an entry to one of the dictionary files, consider the following:

  1. The order of entries in the spelling dictionary prefixes parameter in your workflow call matters, so the most specific ones, like your own should come before more generic ones, like "cspell".
  2. When confronted with unrecognized words in a spell checking report, consider which of those are actually words that make sense to type, instead of just being remainders (because some parts of the original text were replaced with a space character due to matching an earlier entry) of another word or a technical string.
  3. Also look at the execution log to see where the unrecognized entry is coming from to find out what the original text was in the code. The additional context can help determining how to handle the unrecognized entry.
  4. Rare cases that we don't expect to show up overall more than 3 times and strings that are valid in a single situation should be ignored in-place without adding them to a dictionary file. Placing the #spell-check-ignore-line string somewhere in a line (for example in a comment at the end of a line of code) will exclude that line completely from spell checking. In Markdown, add an HTML comment at the end of the line: <!-- #spell-check-ignore-line -->.

Helper scripts for local development

When using custom dictionary files on top of external ones (such as the ones from check-spelling or Lombiq's), these scripts can help reducing the number of entries you need to add to your own:

  1. Merge-SpellCheckingDictionaryFile.ps1: Use this to maintain your excludes.txt file by adding the entries from another file, while still keeping your own. To just remove duplicates and sort the entries alphabetically in a single configuration file, pass in the same file for both parameters.
  2. Optimize-SpellCheckingDictionaryFile.ps1: Use this to remove entries from your dictionary files that are already present in an external one you're referencing.

@dorraj07 dorraj07 changed the title OSOE-545 : Automatically assign GitHub issue corresponding to a pull requests based on Jira issue key in Lombiq.GitHub.Actions OSOE-545: Automatically assign GitHub issue corresponding to a pull requests based on Jira issue key in Lombiq.GitHub.Actions Feb 5, 2023
.github/workflows/validate-pull-request.yml Outdated Show resolved Hide resolved
@@ -20,7 +20,7 @@ jobs:
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copy link
Member

Choose a reason for hiding this comment

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

Okay, so what you did revert was actually the spaces which we don't need. What we need here is a simple new line, do you see this?
image
Those are spaces that are not needed. I pushed the fix for this so we are not doing more rounds on this.

@wAsnk
Copy link
Member

wAsnk commented Feb 13, 2023

Please don't forget to add "Fixes #no" to the description whenever you open a PR that fixes a GitHub issue. I added it now.

@wAsnk wAsnk merged commit f9a7ae5 into dev Feb 15, 2023
[string] $GitHubRepository
)

$Jira_Key = if ("$Body" -match '\[(.*?)\]')
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't have this unconventional variable name and e.g. $IssueQuery below be caught by PS analysis, @BenedekFarkas @DAud-IcI?

Copy link
Member

Choose a reason for hiding this comment

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

Here are the list of built-in rules, I don't see anything regarding variable name styling.

We could create our own rule. If PSScriptAnalyzer can identify local variable declaration, that's when we should enforce no underscores and lower case first letter.

Copy link
Member

Choose a reason for hiding this comment

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

I see, thanks.

Copy link
Member

Choose a reason for hiding this comment

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

How about this (added some extra details): Lombiq/PowerShell-Analyzers#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically assign GitHub issue corresponding to a pull requests based on Jira issue key (OSOE-545)
5 participants