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

ExternalLinksParser rework #4425

Merged
merged 2 commits into from Feb 5, 2018
Merged

Conversation

RussKie
Copy link
Member

@RussKie RussKie commented Feb 3, 2018

ExternalLinksParser implementation is convoluted and is a mix of a number of different concerns - e.g. loading and saving definition to/from files, keeping track of current definitions, aggregating defintions across settings layers, parsing GitRevision for external links.

  • ExternalLinksParser renamed to ExternalLinksManager. The manager remains stateful maintaining a collection of definitions at the top settings level.
  • Extract Load and Save functionality into ExternalLinksLoader. Functionality is simplified to deal with only supplied layer of settings.
  • Extract ExternalLinksParser.Parse to GitRevisionExternalLinksParser. Used by CommitInfo while loading commit information and applying configured external links.
  • Extract effective external links configuration loading into
    ConfiguredLinkDefinitionsProvider. Definitions are loaded across different
    layers of configuration. This is used by GitRevisionExternalLinksParser.

Added unit and integration tests.

What did I do to test the code and ensure quality:

  • created tests before the refactor Add tests for ExternalLinksParser #4342 which were run after the refactor to ensure behavioural parity
  • run v2.51 alongside a debug build to ensure behavioural parity
  • added new unit tests

Has been tested on (remove any that don't apply):

  • GIT 2.12 and above
  • Windows 8, 8.1, 10

Rename ExtLink* objects and the namespace to provide clearer idea about
the intent.
ExternalLinksParser implementation is convoluted and is a mix of a number
of different concerns - e.g. loading and saving definition to/from files,
keeping track of current definitions, aggregating defintions across settings
layers, parsing GitRevision for external links.

* ExternalLinksParser renamed to ExternalLinksManager. The manager
remains stateful maintaining a collection of definitions at the top settings level.
* Extract Load and Save functionality into ExternalLinksLoader.
Functionality is simplified to deal with only supplied layer of settings.
* Extract ExternalLinksParser.Parse to GitRevisionExternalLinksParser.
Used by CommitInfo while loading commit information and applying
configured external links.
* Extract effective external links configuration loading into
ConfiguredLinkDefinitionsProvider. Definitions are loaded across different
layers of configuration. This is used by GitRevisionExternalLinksParser.

Added unit and integration tests.
@RussKie RussKie added this to the 3.00 milestone Feb 3, 2018
Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

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

Reviewed and briefly tested. No comments, follows your design patterns.

{
_definitions.Add(definition);
}
// TODO: else notify the user?
Copy link
Member

Choose a reason for hiding this comment

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

Should be OK to not notify

@RussKie RussKie merged commit 2386d24 into gitextensions:master Feb 5, 2018
@RussKie RussKie deleted the refactor_ExtLinks branch February 5, 2018 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants