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

[JENKINS-54858] Enhance organization & Repository Name Extraction for Multiple URL Formats /feature/org-repo-name-extraction #1646

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

Conversation

mohdishaq786
Copy link

@mohdishaq786 mohdishaq786 commented Aug 26, 2024

Display Organization/Project and Repository Names

Description
This update introduces the following enhancements:

  • Display of Organization/Project and Repository names on the job detail page and the Git build data page.
  • Addition of a global regular expression configuration on the configuration page, supporting all protocols to extract organization and repository names.
  • Users can define custom regular expressions for specific use cases.
  • Test cases have been added to validate these changes.

Issue Reference
https://issues.jenkins.io/browse/JENKINS-54868

Testing done

  1. Unit Tests:
  • Added tests to ensure the accuracy of the getRepoName and getOrganizationName functions, covering various
    protocols and scenarios.

  • Verified that the extracted organization and repository names are correctly processed and available for display on the relevant pages.

  1. Build Verification:
  • Executed mvn clean verify to run all tests, confirming that the changes do not introduce any regressions.
  • Executed mvn clean -DskipTests verify to validate the build process without running tests, ensuring that the build is successfull.

3.Interactive Testing:

  • Manually tested the UI to verify that the organization and repository names are correctly displayed on the job detail page and the Git build data page.

  • Set up a global regular expression on the global configuration page to extract organization and repository names. Verified that this setup is correctly applied and functioning as expected.

  • Attached below is a screenshot of the UI after the changes were applied, including the setup of the global regular expression:

  • Screenshot from 2024-08-27 16-31-49

  • Screenshot from 2024-08-27 16-32-06

  • Screenshot from 2024-08-27 15-11-15

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

@mohdishaq786 mohdishaq786 requested a review from a team as a code owner August 26, 2024 09:05
@github-actions github-actions bot added the tests Automated test addition or improvement label Aug 26, 2024
@MarkEWaite
Copy link
Contributor

@mohdishaq786 please complete the sections in the pull request template, especially the "Testing done" section. We expect that the pull request template is completed so that the reviewers know what testing you have done and how you have confirmed that the changes are working as expected. Interactive testing is especially important for this change because I'm not confident that the existing tests will cover the changes in this pull request.

@github-actions github-actions bot added the dependencies Dependency related change label Aug 26, 2024
@MarkEWaite
Copy link
Contributor

MarkEWaite commented Aug 26, 2024

I ran a quick interactive test and was surprised to see that the organization name and repository name reported that the global regex is not set up:

screencapture-rhel-8-a-markwaite-net-8080-jenkins-job-github-freestyle-1-2024-08-26-17_18_17-edit

@MarkEWaite MarkEWaite changed the title [JENKINS-54858]/Enhance organization & Repository Name Extraction for Multiple URL Formats /feature/org-repo-name-extraction [JENKINS-54858] Enhance organization & Repository Name Extraction for Multiple URL Formats /feature/org-repo-name-extraction Aug 26, 2024
@mohdishaq786
Copy link
Author

mohdishaq786 commented Aug 26, 2024

hi @MarkEWaite Thank you for the feedback! I actually ran an interactive test after setting up the global regex and got the expected results. I've attached a screenshot of the test outcome to demonstrate that the organization name and repository name are being extracted correctly. Please let me know if there are any other concerns or if you need further adjustments.
Screenshot from 2024-08-27 05-12-24
.

@mohdishaq786
Copy link
Author

mohdishaq786 commented Aug 27, 2024

you can stepup globalReqx url in global configuration page
Screenshot from 2024-08-27 05-30-09

@MarkEWaite
Copy link
Contributor

you can setup globalReqx url in global configuration page

I think that it is a mistake to require the user to configure something on the global configuration page before they see the desired values on the build data page. I did not visit the global configuration page and would not expect most users to visit the configuration page.

I think that is a mistake to add the calculated values of the organization name and the repository to the build data. There are already cases where the contents of the build data record grows excessively. The value of the organization name and the repository can be computed at display time rather than being stored in the build data record.

I think that if the organization name or the repository cannot be determined, then that field should not be displayed. Showing the user a "this field is not known" will cause them to be perplexed why the data is not known.

@mohdishaq786
Copy link
Author

if the organization name or the repository cannot be determined, then that field should not be displayed.

I have gone through some previous comments of yours where you have praised a suggestion of setting up global regex in global config page(screenshot attached),thats why I have implemented the said. As per your suggestion where most of user will not go to global config page, in that scenario shall I add a functionality to extract org name and repo name by default regex.Also I will add if the organization name or the repository cannot be determined, then that field should not be displayed instead of "field not know".

Screenshot from 2024-08-27 16-02-25

@MarkEWaite
Copy link
Contributor

shall I add a functionality to extract org name and repo name by default regex

Yes, the out of the box default needs to detect the typical repository URLs without requiring that the user must visit the configuration page.

I'll be out of the office and away from computers for about two weeks. Reviews will be delayed until then (at least).

@mohdishaq786
Copy link
Author

mohdishaq786 commented Sep 13, 2024

@MarkEWaite I’ve completed the feature to automatically detect repository URLs and extract the organization and repository names without requiring users to manually visit the configuration page.

@MarkEWaite MarkEWaite removed the dependencies Dependency related change label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Automated test addition or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants