Commit Graph

7 Commits

Author SHA1 Message Date
Claude 7407b7ab49 fix(ci): address Copilot PR #69 review concerns - improve workflow reliability
ISSUES IDENTIFIED BY COPILOT:

1. **PR URL Detection Logic Issue (Lines 149-153)**
   - Using '|| true' suppressed errors and captured stderr
   - String matching for "github.com" could produce false positives
   - No structured validation of PR creation success

2. **Auto-merge Fallback Logic Problem (Lines 160-162)**
   - Fallback merge without --auto would fail immediately
   - Required status checks haven't completed when PR just created
   - Branch protection rules would block immediate merge

3. **Insufficient Token Permissions Documentation (Lines 15-17)**
   - Default GITHUB_TOKEN may lack auto-merge permissions
   - No guidance on alternative authentication methods

SOLUTIONS APPLIED:

 **Issue #1 - Reliable PR Detection:**
   - Use '--json url,number' flag for structured output
   - Parse JSON with jq for reliable success detection
   - Extract PR URL and number separately
   - Proper error handling for duplicate PRs
   - Check for existing PRs if creation fails

 **Issue #2 - Remove Dangerous Fallback:**
   - Removed immediate merge fallback (gh pr merge without --auto)
   - Keep only --auto flag which queues merge when checks pass
   - Added informative error messages explaining why auto-merge might fail
   - Better user guidance on what to do when auto-merge unavailable

 **Issue #3 - Document Permission Requirements:**
   - Added comment explaining token permission requirements
   - Documented when PAT or GitHub App token might be needed
   - Referenced in error messages for troubleshooting

IMPROVEMENTS:

- Better error messages with emojis for visual clarity
- Extracts both URL and PR number for better logging
- Checks for existing PRs on creation failure
- Explains common reasons for auto-merge failures
- More robust error handling throughout

TESTING:
- YAML syntax validated
- JSON parsing logic tested
- All Copilot concerns addressed

Related: PR #69 code review comments
https://claude.ai/code/session_0149ZKk2ygmKCJTGu39Mr8oH
2026-02-03 01:13:32 +00:00
Claude 1fa321c0a2 fix(ci): correct Yarn 4 cache paths and add auto-merge for version PRs
- Fixed cache paths for Yarn 4 (node_modules + .yarn/install-state.gz)
- Updated all workflows to use actions/cache@v4
- Added auto-merge for WhatsApp version update PRs

https://claude.ai/code/session_01QPt4WssG6jjEciQKdVpFtK
2026-02-02 18:20:03 +00:00
Claude 16699781c7 fix(ci): add GITHUB_TOKEN authentication for git operations
Yarn 4 converts HTTPS URLs to SSH internally. Added token-based
authentication using GITHUB_TOKEN to allow accessing public GitHub
repositories without SSH keys.

https://claude.ai/code/session_01QPt4WssG6jjEciQKdVpFtK
2026-02-02 17:47:08 +00:00
Claude 72c49352a3 fix(ci): configure git to use HTTPS for GitHub dependencies
Fixes "Permission denied (publickey)" error when Yarn tries to fetch
libsignal dependency via SSH in GitHub Actions.

Added git config to force HTTPS instead of SSH for all GitHub URLs
in all workflows that run yarn install.

https://claude.ai/code/session_01QPt4WssG6jjEciQKdVpFtK
2026-02-02 16:45:41 +00:00
Claude 46ffaf027c fix: address PR review comments
Fixes from code review:

1. Fix #1,6: Use connection.update event instead of overriding sock.end()
   - Listens for 'close' event to cleanup interval
   - Handles both explicit close and internal disconnections

2. Fix #3: Exit code 2 when fetch fails (not 0)
   - Allows CI to distinguish success/error/fetch-failed
   - Properly signals fetch failures to workflows

3. Fix #4: Document revision bounds + add env vars
   - Added detailed comments explaining min/max revision values
   - Made configurable via WA_MIN_REVISION/WA_MAX_REVISION env vars

4. Fix #5,9: Remove unused fetchLatestVersion option
   - Removed from SocketConfig and defaults
   - Updated versionCheckIntervalMs docs to clarify it's only for makeWASocketAutoVersion

5. Fix #7: Use separate variable for version tracking
   - trackedVersion instead of mutating mergedConfig
   - Prevents unexpected side effects

6. Fix #8: Check socket state before emitting events
   - isSocketClosed flag to prevent race conditions
   - Double-check after async operations

7. Fix #10: Implement force parameter in workflow
   - Creates PR even without version changes when force=true
   - Useful for re-triggering updates manually

Note: Test coverage (Fix #2) deferred to separate PR due to
ESM mocking complexity with Jest.
2026-01-21 17:21:49 +00:00
Claude b9a7c2cabc feat: improve version update robustness and frequency
Changes:
- Update frequency: weekly → daily (06:00 UTC)
- Add retry with exponential backoff (3 attempts per source)
- Add multiple source endpoints (sw.js + bootstrap page)
- Add version validation (sanity checks on revision numbers)
- Add fetch timeout to prevent hanging
- Add detailed logging for debugging
- Simplify workflow to only update baileys-version.json

This makes the version update more reliable and responsive
to WhatsApp Web changes.
2026-01-21 16:22:46 +00:00
João Lucas de Oliveira Lopes d4ef73aca5 feat: implement automated WhatsApp version update workflow and related scripts (#2130)
* feat: implement automated WhatsApp version update workflow and related scripts

* change cron to weekly

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2026-01-18 01:07:05 +02:00