[go: nahoru, domu]

Skip to content

Latest commit

 

History

History
107 lines (67 loc) · 2.59 KB

ARCHITECTURE.md

File metadata and controls

107 lines (67 loc) · 2.59 KB

Architecture

Use case flows

Create branch

Show/hide
graph TD;
  Start([Start]) --> getIssue

  getIssue -->|Not found| getIssueError([Error])
  getIssue(Get issue from issue tracker) --> getIssueType

  getIssueType -->|Unknown type| getIssueTypeErr([Error])
  getIssueType(Get issue type from issue **) --> generateBranchName
  
  generateBranchName -->|Branch already exists| generateBranchNameErr([Error])
  generateBranchName(Generate branch name from Issue **) --> getBaseBranch

  getBaseBranch(Get base branch from repository) -->  checkoutBranch

  checkoutBranch(Create branch from origin **) --> End

  End([End])

Loading

** The user may need to enter input manually in interactive mode

Create pull request

Show/Hide
graph TD;
  Start([Start]) --> getBranchName

  getBranchName(Get branch name **) --> checkLocalBranch 
  
  checkLocalBranch(Check local branch exists)
  checkLocalBranch -->|Branch exists| checkoutBranch
  checkLocalBranch -->|Missing branch| createLocalBranch

  createLocalBranch(Create local branch **) --> checkoutBranch

  checkoutBranch(Checkout branch) --> checkPendingCommits

  checkPendingCommits(Check local pending commits **)
  checkPendingCommits -->|Pending commits| pushBranch
  checkPendingCommits-->|No commits| checkRemoteBranch

  checkRemoteBranch(Check remote branch exists)
  checkRemoteBranch -->|No remote branch| createEmptyCommit
  checkRemoteBranch -->|Remote branch exists| checkPrExists

  createEmptyCommit(Create empty commit **) --> pushBranch

  pushBranch(Push branch to remote **) --> checkPrExists

  checkPrExists(Check open PR already exists)
  checkPrExists -->|Open PR exists| checkPrExistsErr([Error])
  checkPrExists -->|No open PR| createPr

  createPr(Create Pull Request **) --> End

  End([End])
Loading

** The user may need to enter input manually in interactive mode

CLI flow

Show/hide
graph TD;
  Start([Start]) --> 

  readArgs(Read args) --> validateArgs

  validateArgs -->|Invalid| validateArgsErr([Error])
  validateArgs(Validate args) --> validateConfig

  validateConfig -->|Invalid| validateConfigErr([Error])
  validateConfig(Validate configuration) --> checkGhAuth

  checkGhAuth -->|Unauthenticated| checkGhAuthErr([Error])
  checkGhAuth[/Check github authentication/] --> checkGitRepo

  checkGitRepo -->|Not a git repository| checkGitRepoErr([Error])
  checkGitRepo(Check execution within git repository) -->

  E[[Execute use case]] -->

  End([End])
Loading