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

DDD links #2429

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

DDD links #2429

wants to merge 3 commits into from

Conversation

JoeCohen
Copy link
Member

@JoeCohen JoeCohen commented Sep 29, 2024

Creates links from relevant Name and Observation pages to an ongoing project to document all PNW mushrooms using DNA analysis. The relevant pages are Names of the form XXX "xxx-PNW-nnn", and Observations whose consensus id takes that form. (DDD = Danny's DNA Discoveries)

TODO

  • Add link to Observation pages which propose such a Name
  • also check for Names whose author includes PNW, e.g. sensu PNW.

- DDD == Danny's DNA Discoveries -- project to document all mushrooms species that occur in the Pacific Northwest based on DNA analysis
@JoeCohen JoeCohen linked an issue Sep 29, 2024 that may be closed by this pull request
get(:show, params: { id: name.id })

assert_select("div#nomenclature a:match('href',?)",
%r{https://www.alpental.com/psms/ddd/index.htm}, true,

Check failure

Code scanning / CodeQL

Incomplete regular expression for hostnames High test

This regular expression has an unescaped '.' before 'alpental.com/psms/ddd/index', so it might match more hosts than expected.

Copilot Autofix AI about 1 month ago

To fix the problem, we need to escape the . characters in the regular expression to ensure that they match literal dots rather than any character. This will make the regex more precise and prevent it from matching unintended URLs.

  • Locate the regular expression on line 648 in the file test/controllers/names_controller_test.rb.
  • Modify the regex to escape the . characters by replacing each . with \..
Suggested changeset 1
test/controllers/names_controller_test.rb

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/test/controllers/names_controller_test.rb b/test/controllers/names_controller_test.rb
--- a/test/controllers/names_controller_test.rb
+++ b/test/controllers/names_controller_test.rb
@@ -647,3 +647,3 @@
     assert_select("div#nomenclature a:match('href',?)",
-                  %r{https://www.alpental.com/psms/ddd/index.htm}, true,
+                  %r{https://www\.alpental\.com/psms/ddd/index\.htm}, true,
                   "Page is missing a link to PNW cryptonym page")
EOF
@@ -647,3 +647,3 @@
assert_select("div#nomenclature a:match('href',?)",
%r{https://www.alpental.com/psms/ddd/index.htm}, true,
%r{https://www\.alpental\.com/psms/ddd/index\.htm}, true,
"Page is missing a link to PNW cryptonym page")
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
get(:show, params: { id: obs.id })

assert_select("a:match('href',?)",
%r{https://www.alpental.com/psms/ddd/index.htm}, true,

Check failure

Code scanning / CodeQL

Incomplete regular expression for hostnames High test

This regular expression has an unescaped '.' before 'alpental.com/psms/ddd/index', so it might match more hosts than expected.

Copilot Autofix AI about 1 month ago

To fix the problem, we need to escape the . characters in the regular expression to ensure they match literal dots rather than any character. This will make the regex more precise and prevent it from matching unintended URLs.

  • Update the regular expression on line 314 to escape the . characters.
  • No additional methods, imports, or definitions are needed.
Suggested changeset 1
test/controllers/observations_controller/observations_controller_show_test.rb

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/test/controllers/observations_controller/observations_controller_show_test.rb b/test/controllers/observations_controller/observations_controller_show_test.rb
--- a/test/controllers/observations_controller/observations_controller_show_test.rb
+++ b/test/controllers/observations_controller/observations_controller_show_test.rb
@@ -313,3 +313,3 @@
     assert_select("a:match('href',?)",
-                  %r{https://www.alpental.com/psms/ddd/index.htm}, true,
+                  %r{https://www\.alpental\.com/psms/ddd/index\.htm}, true,
                   "Page is missing a link to PNW cryptonym page")
EOF
@@ -313,3 +313,3 @@
assert_select("a:match('href',?)",
%r{https://www.alpental.com/psms/ddd/index.htm}, true,
%r{https://www\.alpental\.com/psms/ddd/index\.htm}, true,
"Page is missing a link to PNW cryptonym page")
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@coveralls
Copy link
Collaborator

coveralls commented Sep 29, 2024

Coverage Status

coverage: 93.466% (+0.003%) from 93.463%
when pulling 2f12c54 on 2427-ddd-link
into 73a064a on main.

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.

DDD link for PNW Names
2 participants