[CHORE] Use .gitattributes to ignore export files list#46
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors the release and test workflows to use Git’s archive mechanism (driven by .gitattributes) instead of rsync-based exclusion lists for building/staging the plugin artifacts. Flow diagram for plugin packaging before and after git archive changeflowchart LR
subgraph Before_change_rsync_based
A[Checkout repository] --> B[Create /tmp/ipquery directory]
B --> C[Run rsync with many --exclude patterns]
C --> D[Staged plugin tree in /tmp/ipquery]
D --> E[zip -r ipquery-VERSION.zip ipquery/]
E --> F[Upload/use ZIP artifact]
end
subgraph After_change_git_archive_based
A2[Checkout repository] --> B2[Run git archive HEAD]
B2 --> C2[.gitattributes controls exported files]
C2 --> D2[Extract archive to /tmp/ipquery or write ZIP directly]
D2 --> E2[ipquery-VERSION.zip from git archive]
E2 --> F2[Upload/use ZIP artifact]
end
style Before_change_rsync_based fill:#f9f9f9,stroke:#bbb
style After_change_git_archive_based fill:#f9f9f9,stroke:#bbb
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Since
git archivenow controls what goes into the plugin package, double‑check that.gitattributesmarks all previouslyrsync-excluded paths (e.g..github,tests,docs, build/config files) withexport-ignoreso the resulting archive matches the old contents. git archive HEADonly includes committed files, whereas the previousrsyncapproach would pick up uncommitted build artifacts; if your release process relies on generated files, consider adding an explicit build step that commits or stages them, or document that releases must be created from clean commits.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since `git archive` now controls what goes into the plugin package, double‑check that `.gitattributes` marks all previously `rsync`-excluded paths (e.g. `.github`, `tests`, `docs`, build/config files) with `export-ignore` so the resulting archive matches the old contents.
- `git archive HEAD` only includes committed files, whereas the previous `rsync` approach would pick up uncommitted build artifacts; if your release process relies on generated files, consider adding an explicit build step that commits or stages them, or document that releases must be created from clean commits.
## Individual Comments
### Comment 1
<location path=".github/workflows/release.yml" line_range="144" />
<code_context>
- ./ /tmp/ipquery/
- cd /tmp
- zip -r "ipquery-${VERSION}.zip" ipquery/
+ git archive HEAD --prefix=ipquery/ --output="/tmp/ipquery-${VERSION}.zip"
echo "ZIP=/tmp/ipquery-${VERSION}.zip" >> "$GITHUB_ENV"
</code_context>
<issue_to_address>
**issue (bug_risk):** The `git archive` output is likely a tar stream despite the `.zip` extension; consider explicitly setting `--format=zip`.
This mismatch will likely break any consumer expecting a real zip file. You can align the content with the extension by using:
git archive --format=zip HEAD --prefix=ipquery/ --output="/tmp/ipquery-${VERSION}.zip"
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 52 minutes and 8 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe changes transition from filesystem-based Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.gitattributes (1)
1-18: LGTM — solid export-ignore list.Leading-slash anchoring is correct, directory entries are properly trailing-slashed, and
/vendor/vs.includes/vendor/will work as intended. Keepingreadme.txtwhile excluding/README.mdis the right call for WP.org packaging.One optional thought: if the repo ever grows any of these top-level dev/config files, consider adding them here as well so they never leak into the zip:
/.editorconfig,/.prettierrc*,/.eslintrc*/package.json,/package-lock.json,/node_modules//.phpcs.xml.dist(in case a dist config is introduced alongsidephpcs.xml)/.distignore(legacy, if any tool expects it)Not blocking — none of these appear to exist today based on
composer.json.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.gitattributes around lines 1 - 18, Add optional dev/config patterns to .gitattributes to ensure they are excluded from release archives; specifically add leading-slash anchored entries for /.editorconfig, /.prettierrc*, /.eslintrc*, /package.json, /package-lock.json, /node_modules/, /.phpcs.xml.dist, and /.distignore so these top-level config and node artifacts never get packaged into export zip files; update the .gitattributes file by appending these export-ignore lines using the same anchoring and trailing-slash conventions already present.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.gitattributes:
- Around line 1-18: Add optional dev/config patterns to .gitattributes to ensure
they are excluded from release archives; specifically add leading-slash anchored
entries for /.editorconfig, /.prettierrc*, /.eslintrc*, /package.json,
/package-lock.json, /node_modules/, /.phpcs.xml.dist, and /.distignore so these
top-level config and node artifacts never get packaged into export zip files;
update the .gitattributes file by appending these export-ignore lines using the
same anchoring and trailing-slash conventions already present.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 33307b83-c2c4-4131-ad5c-6e91d984fe3e
📒 Files selected for processing (3)
.gitattributes.github/workflows/release.yml.github/workflows/test.yml
|
Failed to generate code suggestions for PR |
📑 Description
Use .gitattributes to ignore export files list
✅ Checks
☢️ Does this introduce a breaking change?
Summary by Sourcery
Use Git archive-based packaging controlled by .gitattributes for plugin staging and release artifacts.
Build:
CI:
Summary by CodeRabbit