Adding New Repos Guide
Have you ever wanted to add new upstream repos? Well now you can!
First ensure that your upstream repo is on the Fed Message Bus
- Now add two new functions to sync2jira/upstream_pr.py and sync2jira/upstream_issue.py
def hande_REPO-NAME_message(msg, config)This function will take in a fedmessage message (msg) and the config dict
This function will return a
sync2jira.Intermediary.IssueobjectThis function will be used when listening to the message bus
def REPO-NAME_issues(upstream, config)This function will take in an upstream repo name and the config dict
This function will return a generator of
sync2jira.Intermediary.Issueobjects that contain all upstream IssuesThis function will be used to initialize and sync upstream/downstream issues
- Now modify the sync2jira/main.py functions:
def initialize_pr(config, ...)anddef initialize_issues(config, ...)Add another section (like GitHub) to utilize the
REPO-NAME_issuesfunction you just made.
def listen(config)- Add another section to the if statement under GitHub
elif 'REPO-NAME' in suffix:Now utilize the
handle_REPO-NAME_messagefunction you just made
If all goes smoothly, your new repo should work with Sync2Jira!
Note
If you want to submit a Pull Request, ensure that you add appropriate Unit Tests, Tox is passing, and you have appropriate documentation!