Skip to content

Commit

Permalink
Add documentation for new comparison strategy to README
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanalvarado committed Jan 19, 2025
1 parent 12a9c6d commit bedb544
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,16 @@ affectedModuleDetector {
- `logFilename`: A filename for the output detector to use
- `logFolder`: A folder to output the log file in
- `specifiedBranch`: A branch to specify changes against. Must be used in combination with configuration `compareFrom = "SpecifiedBranchCommit"`
- `specifiedRawCommitSha`: A raw commit SHA to specify changes against. Must be used in combination with configuration `compareFrom = "SpecifiedRawCommitSha"`
- `ignoredFiles`: A set of files that will be filtered out of the list of changed files retrieved by git.
- `buildAllWhenNoProjectsChanged`: If true, the plugin will build all projects when no projects are considered affected.
- `compareFrom`: A commit to compare the branch changes against. Can be either:
- PreviousCommit: compare against the previous commit
- ForkCommit: compare against the commit the branch was forked from
- SpecifiedBranchCommit: compare against the last commit of `$specifiedBranch` using `git rev-parse` approach.
- SpecifiedBranchCommitMergeBase: compare against the nearest ancestors with `$specifiedBranch` using `git merge base` approach.

- SpecifiedRawCommitSha: compare against the provided raw commit SHA.

**Note:** specify the branch to compare changes against using the `specifiedBranch` configuration before the `compareFrom` configuration
- `excludedModules`: A list of modules that will be excluded from the build process, can be the name of a module, or a regex against the module gradle path
- `includeUncommitted`: If uncommitted files should be considered affected
Expand Down Expand Up @@ -162,6 +164,12 @@ Suppose we have changed 6 files in our "feature" branch.

Hence, depending on your CI settings you have to configure AMD appropriately.

## SpecifiedRawCommitSha

If you want AMD plugin to skip performing the git operations under-the-hood (like `git rev-parse` and `git merge base`), you can provide the raw commit SHA you wish to compare against.
One of the main reasons you might want to follow this approach is, maybe your environment leverages [Git mirroring](https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository) for speed optimizations, for example CI/CD environments.
Mirroring _can_ lead to inaccurate common ancestor commits as the duplicated repository _may be_ out of sync with the true remote repository.

## Sample Usage

Running the plugin generated tasks is quite simple. By default, if `affected_module_detector.enable` is not set,
Expand Down

0 comments on commit bedb544

Please sign in to comment.