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 gh service #75

Merged
merged 5 commits into from
Jul 15, 2024
Merged

Add gh service #75

merged 5 commits into from
Jul 15, 2024

Conversation

sridamul
Copy link
Contributor

Added GH service class which allows us to fork and clone plugin, commit the changes (after transformation) and PR creation.

Note: GH token and username is passed through system env variables.

This is a rough PR, open to improvements. Thanks!

Testing done

This PR is automated with the tool starting from forking, cloning and PR creation

Log file

Starting Plugin Modernizer 
Plugins: [login-theme-plugin] 
Recipes: [AddPluginsBom] 
Forking and cloning login-theme-plugin locally 
Forking the repository... 
Repository forked successfully 
Cloning login-theme-plugin 
Cloned successfully 
Invoking clean phase for plugin: login-theme-plugin 
Invoking rewrite plugin for plugin: login-theme-plugin 
Creating pull request for plugin: login-theme-plugin 
Changes committed 
Pushed changes to forked repository 
Pull request created: https://github.com/sridamul/login-theme-plugin/pull/8 

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

@sridamul sridamul requested a review from a team as a code owner July 13, 2024 13:08
@jonesbusy
Copy link
Collaborator

Some minor code issues/improvement and I think we can do ahead with this first integration with JGit/GitHub

Also don't forget to document on the README.md the new parameter of needed environment variables

@sridamul
Copy link
Contributor Author

Tested manually with dry run option.

@sridamul sridamul requested a review from jonesbusy July 15, 2024 05:23
Thread.sleep(5000); // Ensure the completion of Fork
LOG.info("Repository forked successfully.");
} else {
LOG.info("Repository already forked.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please track an issue to ensure the GH repo is in sync with upstream. It should be possible via API

I'm using generally the gh repo sync username/repo

Without sync existing repo there is a risk to open branches from outdated main branch

@jonesbusy jonesbusy merged commit 48688bf into jenkins-infra:main Jul 15, 2024
13 checks passed
@sridamul sridamul deleted the add-gh-service branch July 15, 2024 06:01
@jonesbusy jonesbusy added the enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Jul 15, 2024
@jonesbusy jonesbusy mentioned this pull request Jul 15, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants