Skip to content

Commit

Permalink
Merge pull request #403 from noqdev/chore/minor_gh_doc_fixes
Browse files Browse the repository at this point in the history
Minor fixes for GitHub docs
  • Loading branch information
castrapel committed May 17, 2023
2 parents 267e39a + 7cd78cc commit c596fd3
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions docs/web/docs/1-getting_started/7-github.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ permissions from your cloud provider(s).
![IAMbic Git Flow](/img/git/github-settings-menu.png)

3. Add a branch protection rule.
4. Set the branch name pattern to `main`.
4. Set the branch name pattern to `main` (Or the name of your default branch, if it isn't `main`).
5. Configure the options
1. Enable "Require a pull request before merging".
1. Enable "Require Approvals".
Expand Down Expand Up @@ -299,13 +299,15 @@ Return to the GitHub App settings page to connect the GitHub App to the Lambda t
16. Select your IAMbic templates repository under "Repository access" section.
17. Click Save.

### Enable iambic-integrations to bypass review rules for "main" branch
### Enable iambic-integrations to bypass review rules for default branch

Typical pull-requests review flow requires reviewers approval. Action such as auto import, auto expire require changes being pushed back into main branch without manual approvals.

In the typical review flow for pull requests, approval from reviewers is necessary. However, certain actions like auto import or auto expiration
involve pushing changes back to the default branch without requiring manual approvals.

1. Go to your iambic templates repository settings (https://github.com/ExampleOrg/ExampleIambicTemplatesRepository/settings).
2. Click "Branches" in the top left navigation.
3. Click on "Edit" for "main" under "Branch protection rules".
3. Click on "Edit" for your default branch (typically "main" or "master") under "Branch protection rules".
4. Click on "Allow specified actors to bypass required pull requests".
5. In "Search for people, teams or apps", type in `iambic-integrations` to click on the GitHub App we have created.
6. Click "Save changes".
Expand All @@ -316,25 +318,31 @@ Typical pull-requests review flow requires reviewers approval. Action such as au

#### Open a pull request on your iambic-template repo

1. `git checkout -b task/change_description origin/main`
2. Edit one of your description within your templates, like `resources/github/iam_role_lambda.yaml`. <!-- #TODO edit to what?? -->
3. Add your changes to your branch, and push it to github:
1. `default_branch=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')`
2. `git checkout -b task/change_description "$default_branch"`
3. Edit one of your description within your templates, like `resources/github/iam_role_lambda.yaml`. <!-- #TODO edit to what?? -->
4. Add your changes to your branch, and push it to github:
```bash
git add resources/github/iam_role_lambda.yaml
git commit -m "Change Description"
git push origin HEAD
```
4. Create a pull request.
5. The installed GitHub App will comment with plan the changes. Any time you want iambic github action to re-plan the changes, you can comment `iambic plan`.
6. The plan will be a comment in line, as long as it is less than 65kb. (Be very careful with big plans because those are difficult for reviewers to review.) <!-- #TODO So then what? What's the alternative? -->
7. Add reviewers to review your PR and plan that is in the PR comments.
8. Once your reviewer approves your changes, add comment `iambic apply` to have iambic apply the changes. If the changes can be successfully applied, the PR will be automatically merged into main as well.
5. Create a pull request.
6. The installed GitHub App will comment with plan the changes. Any time you want iambic github action to re-plan the changes, you can comment `iambic plan`.
7. The plan will be a comment in line, as long as it is less than 65kb. Larger plans are uploaded to a gist and linked as a comment in the PR
8. Add reviewers to review your PR and plan that is in the PR comments.
9. Once your reviewer approves your changes, add comment `iambic apply` to have iambic apply the changes. If the changes can be successfully applied, the PR will be automatically merged into main as well.

<!--

## FAQ

1. The `plan` and `apply` process are performed via merge workflow. main branch is first checked out and then merge the changes requested in the PR. This is to ensure the plan is as up-to-date as possible. At any time if there is conflict, the requester should pull origin/main into the PR branch and allow iambic github action to replan the changes.
1. The process of executing the plan and apply operations follows a merge workflow.
Initially, the default branch (usually origin/main or origin/master) is checked out,
and the requested changes from the pull request are merged into it. This ensures that
the plan reflects the most current state. If conflicts arise at any point, the requester
should pull their default branch into the pull request branch and let the IAMbic GitHub
action replan the changes accordingly.

2. Do I need a dedicated GitHub account to run IAMbic?

Expand Down

0 comments on commit c596fd3

Please sign in to comment.