Skip to content

Drop Project-and-Username-finding code #451

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

Conversation

olleolleolle
Copy link
Collaborator

@olleolleolle olleolleolle commented Nov 13, 2016

This PR is a refactoring to extract a large section of unrelated-to-option-parsing code from the option parser.

- [ ] improve extracted class name - is RepoSlugParser better?
- [ ] pore over the specs, esp. the final one, which seems fishy
- [ ] perhaps find a better way to express the "list of strategies" in the new class (#call)
- [ ] turn the default user/project repo slug into some kind of test setup

Update: We did none of those things, we looked long and hard at it, and decided that it would be easier to drop the functionality.

@olleolleolle olleolleolle force-pushed the fix/extract-github-project-name-finder branch 2 times, most recently from e5487ad to 06c5ac1 Compare December 3, 2016 12:53
@@ -0,0 +1,120 @@
# frozen_string_literal: true
module GitHubChangelogGenerator
class ProjectNameFinder
Copy link

Choose a reason for hiding this comment

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

I find that trying to write a class level comment often helps with finding a fitting name. What purpose does this class serve, how does one use it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This class interrogates given CLI options and Git remotes to parse out a GitHub username and a project name, the two parts of what's usually called a GitHub repo slug.

Copy link

Choose a reason for hiding this comment

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

I see, makes sense. Sounds a bit like it does two different things that are not even so related: interrogating options on the one hand, parsing a remote on the other hand. Only the thing that comes out of it is the same.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm also not excited about placing the test data (the default) inside this implementation.

I'll add "turning the default user/project repo slug into some kind of test setup".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And I agree with this being two things.

[Regexp.last_match(:user), Regexp.last_match(:project)]
end
end
end
Copy link

Choose a reason for hiding this comment

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

Forgive me if I've overlooked something, since I'm only looking at this diff right now - but is this method and the following ones only public in order to support being called from the spec? In that case, it might be worth some effort trying to make them private I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think so, too. This is not a part of the usable interface.

@olleolleolle
Copy link
Collaborator Author

olleolleolle commented Dec 5, 2016

Coming up for air after a long dive into this, I now find that I only want to remove this section of the code-base and have an easier time.

It's even easier to explain the thing when the :github_site option's been removed.

I will update this PR with changes to that effect.

@olleolleolle olleolleolle self-assigned this Feb 8, 2017
@olleolleolle olleolleolle force-pushed the fix/extract-github-project-name-finder branch from 06c5ac1 to 81851f9 Compare September 12, 2017 15:30
@olleolleolle
Copy link
Collaborator Author

Ah, like a fine wine, this change has matured over the long summer.

Now I have made the change that I learned I wanted: code deletion.

@olleolleolle olleolleolle changed the title Extract Project Name Finder class Drop Project-and-Username-finding code Sep 12, 2017
@olleolleolle olleolleolle merged commit b36d85e into github-changelog-generator:master Oct 10, 2017
@olleolleolle olleolleolle deleted the fix/extract-github-project-name-finder branch October 10, 2017 17:53
alexjfisher added a commit to alexjfisher/modulesync_config that referenced this pull request Oct 15, 2017
alexjfisher added a commit to alexjfisher/modulesync_config that referenced this pull request Oct 16, 2017
@hunner
Copy link
Contributor

hunner commented Apr 12, 2018

@olleolleolle Is this considered a breaking change from the 1.14.x series? Should the next release be a 2.0.0 instead of a 1.15.0 (not counting the alpha/beta/pre releases)? (There are many dramatic changes, but this may be the only breaking change that isn't technically a bugfix.)

@hunner hunner mentioned this pull request Apr 12, 2018
@olleolleolle
Copy link
Collaborator Author

If we could reimplement the feature with new code, perhaps we stand a better chance of making it work well?

@skywinder skywinder added this to the 2.0.0 milestone Apr 15, 2018
ArtieReus pushed a commit to ArtieReus/github-changelog-generator that referenced this pull request May 8, 2018
PR github-changelog-generator#451 removes the repo-guessing code, which both:

* allows the user and project to be set in the Rake task
* *requires* the user and project to be set in the Rake task

update the Rake example in the README to reflect this new usage
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.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy