Skip to content

fix: compare BASE with merged state instead of HEAD directly #17

Merged
swade1987 merged 9 commits intomainfrom
next
Apr 10, 2025
Merged

fix: compare BASE with merged state instead of HEAD directly #17
swade1987 merged 9 commits intomainfrom
next

Conversation

@swade1987
Copy link
Owner

This PR merges all improvements and fixes from the next branch into main, completing the work to enhance the kustomize-diff GitHub Action. The next branch has been used as a staging area to validate multiple iterations of fixes needed to make the kustomize-diff action work reliably across all GitHub Actions environments.

Key improvements included in this merge

1. Merged state comparison

  • The action now correctly compares the BASE branch with the result of merging HEAD into BAS.E
  • This accurately represents what would change when the PR is merged.
  • Fixes incorrect behavior where parallel changes to BASE would appear to be reverted

2. Branch reference handling

  • Added robust branch reference resolution that works with local branches, remote branches, and commit SHAs
  • Fixed issues with detached HEAD states in GitHub Actions environments
  • Correctly handles references regardless of format (branch name vs. remote/branch)

3. Git identity configuration

  • Added git user identity configuration to enable merge operations in CI environments
  • Prevents "Committer identity unknown" errors during the temporary merge process

4. Enhanced error handling and debugging

  • Improved error messages for easier troubleshooting
  • Added detailed debug logging
  • Better cleanup of temporary resources

Testing
This implementation has been thoroughly tested across multiple repositories and PR scenarios, including:

  1. PRs where BASE has parallel changes
  2. PRs from branches created without the latest BASE changes
  3. Different repository structures and kustomization setups

Related Issues
Closes #11

Signed-off-by: Steven Wade <steven@stevenwade.co.uk>
Signed-off-by: Steven Wade <steven@stevenwade.co.uk>
fix: compare BASE with merged state instead of HEAD directly
Signed-off-by: Steven Wade <steven@stevenwade.co.uk>
Signed-off-by: Steven Wade <steven@stevenwade.co.uk>
fix: improve branch reference handling for kustomize-diff
…-diff

Signed-off-by: Steven Wade <steven@stevenwade.co.uk>
fix: improve branch reference handling and git identity
@swade1987 swade1987 merged commit 8af0d46 into main Apr 10, 2025
4 checks passed
@swade1987
Copy link
Owner Author

🎉 This PR is included in version 0.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diff might be inaccurate if BASE contains changes that aren't on HEAD

1 participant