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

[Halpy-111] Case Management Commands & Notes #336

Merged
merged 33 commits into from
Apr 9, 2023
Merged

Conversation

Rixxan
Copy link
Member

@Rixxan Rixxan commented Mar 17, 2023

Relies upon #334

Key Features:

  • Establishes the base Case Management commands for changing static aspects of Cases.
  • Adds commands needed for Case Note Management to automatically fill some details of cases for notes.
  • Automatically appends new note entries on key commands.
  • Establishes the KFType and CaseType Enums
  • Announcer now raises 400 Bad Request on invalid KingFisher coordinates

Also includes:

  • A new configuration option to specify rescue channels, which should be subsets of joined channels.
  • Improvements to the Board List command to allow platform or case type filtering.
  • Removes a significant amount of now-redundant Debug code.
  • Defines a number of new potential exception types for different situations.
  • If a Client announcement is to include an IRC name, include that name in the announcement.
  • Adds the Case Type to the initial case creation.
  • Updates the Planet Coords and KF Type to use the proper Enums
  • Refactors the get_case function to Packages from Commands
  • Adds a new Enum value for Inactive cases.

Future Enhancements to be Investigated:

  • Confirmation Loops on Some Commands

Closes #327, #111

@Rixxan Rixxan added enhancement New feature or request feature sacm labels Mar 17, 2023
@Rixxan Rixxan added this to the 2.0 milestone Mar 17, 2023
@Rixxan Rixxan self-assigned this Mar 17, 2023
@Rixxan Rixxan linked an issue Mar 18, 2023 that may be closed by this pull request
@Rixxan Rixxan linked an issue Mar 18, 2023 that may be closed by this pull request
@Rixxan Rixxan changed the title Draft: [Halpy-111] Case Management Commands & Notes [Halpy-111] Case Management Commands & Notes Mar 19, 2023
@Rixxan Rixxan marked this pull request as ready for review March 19, 2023 23:46
halpybot/commands/caseutils.py Show resolved Hide resolved
halpybot/commands/caseutils.py Show resolved Hide resolved
Comment on lines 126 to 137
filtered_cases = [
case
for case in caseboard.values()
if (not list_filter)
or (
list_filter
in (
case.platform.name.casefold().replace("_horizons", ""),
case.case_type.name.casefold(),
)
)
]
Copy link
Contributor

Choose a reason for hiding this comment

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

The cognitive complexity of this expression is very high. consider refactoring.

else:
list_filter = None

filtered_cases = [
Copy link
Contributor

Choose a reason for hiding this comment

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

[optimization] replace the list comprehension with a series of generator expressions.
This will allow you to reduce the cognitive complexity and increase expressiveness.
It also turns your current 2 * O(n) into an O(n)

halpybot/commands/caseutils.py Outdated Show resolved Hide resolved
halpybot/commands/caseutils.py Outdated Show resolved Hide resolved
halpybot/commands/caseutils.py Show resolved Hide resolved
halpybot/commands/caseutils.py Outdated Show resolved Hide resolved
halpybot/commands/caseutils.py Outdated Show resolved Hide resolved
halpybot/packages/announcer/announcer.py Show resolved Hide resolved
Rixxan and others added 3 commits March 25, 2023 18:53
Co-authored-by: Joshua Salzedo <thHunkn0WNd@gmail.com>
Signed-off-by: David Sangrey <davidsangrey@gmail.com>
Co-authored-by: Joshua Salzedo <thHunkn0WNd@gmail.com>
Signed-off-by: David Sangrey <davidsangrey@gmail.com>
Co-authored-by: Joshua Salzedo <thHunkn0WNd@gmail.com>
Signed-off-by: David Sangrey <davidsangrey@gmail.com>
@Rixxan Rixxan force-pushed the feature-halpy/111 branch from cdee7e9 to d79b154 Compare March 25, 2023 23:22
@Rixxan Rixxan force-pushed the feature-halpy/111 branch from 401d61c to 5502e13 Compare March 26, 2023 03:54
"""Utilities for Wrapping EDSM Commands"""

@staticmethod
def gather_case(len_args_expected: int):
Copy link
Contributor

Choose a reason for hiding this comment

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

this len_args_expected thing feels bugprone, I am not convinced it should even be a thing.

halpybot/commands/caseutils.py Outdated Show resolved Hide resolved
halpybot/commands/caseutils.py Outdated Show resolved Hide resolved
halpybot/commands/caseutils.py Outdated Show resolved Hide resolved
Co-Authored-By: Joshua Salzedo <joshuasalzedo@gmail.com>
@Rixxan Rixxan merged commit 5949aef into develop Apr 9, 2023
@Rixxan Rixxan deleted the feature-halpy/111 branch April 9, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature sacm
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Manage Case Notes Edit Key Case Information
2 participants