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

Add head name property in MercurialSCM #277

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

long76
Copy link

@long76 long76 commented Jun 4, 2024

If use resolveScm in usual pipeline you cannot get branch name - getRevision return hash althought resolveScm print and branch name too.

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@long76 long76 requested a review from a team as a code owner June 4, 2024 12:40
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

src/main/java/hudson/plugins/mercurial/MercurialSCM.java Outdated Show resolved Hide resolved
@MarkEWaite
Copy link
Contributor

@long76 thanks for the pull request. I think that it would be valuable to add a test of the new methods that have been added so that future changes do not break the new methods.

The Mercurial plugin is currently up for adoption. That means there is currently no active maintainer for the plugin. Since you are using the plugin, are you willing to adopt the plugin and become the maintainer of the plugin?

@long76
Copy link
Author

long76 commented Jun 4, 2024

@long76 thanks for the pull request. I think that it would be valuable to add a test of the new methods that have been added so that future changes do not break the new methods.

The Mercurial plugin is currently up for adoption. That means there is currently no active maintainer for the plugin. Since you are using the plugin, are you willing to adopt the plugin and become the maintainer of the plugin?

thanks but no) we migrate to git but this functionality would be useful. i make our local version this plugin and deploy them. so what happens first our migration or plugin has maintainer)

@long76
Copy link
Author

long76 commented Jun 4, 2024

Feature does not require specific tests

Sure it does.

I guess the description is referring to https://github.com/jenkinsci/workflow-multibranch-plugin/blob/28fbf74dfcaeccbee5f7fbb1ae7d0d3c95cd932d/src/main/java/org/jenkinsci/plugins/workflow/multibranch/ResolveScmStep.java#L282 though it is not clear.

yes you are right. that's what i meant.

@long76
Copy link
Author

long76 commented Jun 6, 2024

@jglick @MarkEWaite add tests

@long76 long76 requested a review from jglick June 6, 2024 17:48
MercurialSCM mercurialSCM = new MercurialSCMBuilder(entry.getKey(), entry.getValue(), "", "")
.build();
assertEquals(MercurialSCM.RevisionType.CHANGESET, mercurialSCM.getRevisionType());
assertEquals(entry.getValue().getHead().getName(), mercurialSCM.getHeadName());
Copy link
Member

Choose a reason for hiding this comment

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

This test is just asserting that a newly introduced method has an expected value. Fine so far as it goes, but does not demonstrate that the purported purpose of the change (to fix some behavior of resolveScm) is actually accomplished by doing that. Is some piece of code using reflection to look for a JavaBeans property named headName? (I certainly hope not!)

Copy link
Author

@long76 long76 Jun 6, 2024

Choose a reason for hiding this comment

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

no reflection here of course) just check all existing heads) resolveScm works correct just it return MercurialSCM where you can get only hash of commit. in fact i dont know which test need for it but my tests confirm that headName correct. maybe need other name of variable) but it's not breaking change like change value of revision from hash to branch name

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.

3 participants