Skip to content

chore: restore git history from helix-deploy#93

Open
trieloff wants to merge 386 commits into
mainfrom
restore-history
Open

chore: restore git history from helix-deploy#93
trieloff wants to merge 386 commits into
mainfrom
restore-history

Conversation

@trieloff

Copy link
Copy Markdown
Contributor

Summary

This PR restores the git history for files that were originally part of helix-deploy before being split into this separate plugin repository.

Before (main branch)

  • src/FastlyGateway.js: 1 commit (starting June 28, 2024)
  • History begins at the "feat: implement plugin" commit

After (this branch)

  • src/FastlyGateway.js: 95 commits (starting December 14, 2020)
  • Full history from when these files were first created in helix-deploy

Files with restored history

  • src/FastlyGateway.js
  • src/FastlyConfig.js
  • src/ComputeAtEdgeDeployer.js
  • src/ComputeAtEdgeConfig.js
  • src/CloudflareDeployer.js
  • src/CloudflareConfig.js
  • src/EdgeBundler.js
  • src/template/* (adapter files, polyfills)
  • Related test files

How this was done

  1. Created a filtered clone of adobe/helix-deploy containing only the edge-related files
  2. Rewrote paths to match the new structure (e.g., src/gateway/FastlyGateway.jssrc/FastlyGateway.js)
  3. Used git replace --graft to connect this repo's first content commit to the filtered history
  4. Baked in the grafts using git filter-repo to make the history permanent

⚠️ Important Notes

  • This rewrites history - commit hashes after the graft point are different
  • The content of files is unchanged, only the history lineage
  • Merging this PR would require a force-push or special merge strategy

Verification

You can verify the restored history with:

git log --oneline src/FastlyGateway.js | wc -l  # Should show ~95 commits
git log --oneline src/FastlyGateway.js | tail -5  # Should show commits from 2020

🤖 Generated with Claude Code

trieloff and others added 30 commits November 4, 2021 17:54
@tripodsan if you mention `edge` before `node` then zipping the action will fail in the bundler
do not use the function name as part of the URL
BREAKING CHANGE: exported APIs only available through ESM
claude and others added 28 commits November 19, 2025 15:53
Use root path for testing to avoid routing issues with nested paths.
The info page should respond to any path that doesn't match specific
cache routes.

Refs #82

Signed-off-by: Lars Trieloff <lars@trieloff.net>
**Integration Tests Added:**
- Compute@Edge: Deploy and test logging-example fixture
- Cloudflare: Deploy and test logging-example fixture (skipped, needs credentials)
- Both tests verify deployment success and logging functionality

**Test Coverage Analysis:**
- Added TEST_COVERAGE.md documenting test coverage strategy
- Cloudflare logger: 96.05% coverage ✅
- Core logic (normalizeLogData, enrichLogData): 100% coverage ✅
- Fastly-specific code: Tested via integration (cannot unit test in Node.js)

**Why Some Code Cannot Be Unit Tested:**
- fastly:logger is a platform-specific module
- fastly:env is only available in Fastly runtime
- These are tested via actual deployments to Fastly Compute@Edge

**Overall Coverage: 56.37%**
This is expected and acceptable because:
1. All testable business logic has >95% coverage
2. Platform-specific code has integration tests
3. Test fixtures demonstrate all features

The logging-example fixture is now verified to:
- Build successfully
- Deploy to both platforms
- Handle all log levels
- Support dynamic logger configuration
- Work in real edge environments

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Remove skip flag to test cache-demo deployment on Cloudflare Workers.
This verifies the CacheOverride API works correctly on Cloudflare.

Refs #82

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Fastly deployment requires at least one package parameter. Added
TEST=logging parameter to both Compute@Edge and Cloudflare integration
tests to satisfy this requirement.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
The deployment requires both package params and action params. Added
-p FOO=bar to match the working integration test pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Changed JSON.stringify to not pretty-print so the response matches
what the integration test expects (minified JSON without spaces).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
- Add CLOUDFLARE_AUTH environment variable to CI workflow
- Update cloudflare.integration.js to use process.env.CLOUDFLARE_AUTH
- Update account ID and test domain for current Cloudflare account
- Remove .skip from Cloudflare integration test

Fixes #87

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
- Add enableSubdomain() method to CloudflareDeployer
- Call enableSubdomain() after worker deployment
- Use POST method to enable subdomain (not PUT)
- Increase retry404 from 0 to 5 for propagation delays
- Requires Workers Scripts:Edit permission on API token

This fixes the issue where deployed workers weren't accessible
on workers.dev due to subdomain not being enabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
- Add POST /subdomain mock to both CloudflareDeployer tests
- Fixes unit test failures from enableSubdomain() addition

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
- Update test assertion from rockerduck to minivelos
- Matches updated account configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
## [1.2.1](v1.2.0...v1.2.1) (2025-11-24)

### Bug Fixes

* enable workers.dev subdomain after deployment ([394dbb4](394dbb4))
…rage

- Add tests for Fastly adapter logger initialization
- Add tests for createFastlyLogger error handling and fallback behavior
- Test all log levels and data normalization/enrichment in Fastly logger
- Verify graceful handling of fastly:logger import failures
- Test fallback to console.log when no loggers configured

These tests improve patch coverage by testing all accessible code paths
in the Fastly logger implementation that can be tested in Node.js.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Cloudflare API credentials are not configured in CI environment.
Created issue #87 to track adding CLOUDFLARE_AUTH secret.

Refs #87, #82

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Update cache-demo Cloudflare test to match the pattern from merged PR #88:
- Remove skip
- Use process.env.CLOUDFLARE_AUTH for credentials
- Update account ID to 155ec15a52a18a14801e04b019da5e5a
- Update test domain to minivelos

Refs #82, #87

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Expands edge-action with three new routes for testing CacheOverride API:
- /cache-override-ttl - Tests TTL override functionality
- /cache-override-pass - Tests pass mode (no caching)
- /cache-override-key - Tests custom cache key

Removes cache-demo fixture and tests to avoid Fastly service ID conflicts.
Both cache-demo and computeatedge were deploying to service 1yv1Wl7NQCFmNBkW4L8htc,
causing deployments to overwrite each other and resulting in 404 errors.

Refs #82

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Instead of deploying the edge-action fixture 4 times (once for each test
route), now deploy once and test all CacheOverride API routes with HTTP
requests. This significantly speeds up the test suite by avoiding
redundant deployments.

The single test now:
1. Deploys edge-action with /201 test route
2. Makes HTTP requests to test CacheOverride routes:
   - /cache-override-ttl
   - /cache-override-pass
   - /cache-override-key

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Removes unnecessary execa dependency by using Node's native fetch API
for testing CacheOverride routes. Node 18+ (project uses Node 24) has
built-in fetch support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
…#90)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
## [1.2.2](v1.2.1...v1.2.2) (2025-11-24)

### Bug Fixes

* **deps:** update dependency @adobe/fastly-native-promises to v3.0.19 ([#90](#90)) ([b2e4a11](b2e4a11))
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
## [1.2.3](v1.2.2...v1.2.3) (2025-11-24)

### Bug Fixes

* **deps:** update external fixes ([#91](#91)) ([02aacb0](02aacb0))
feat: implement context.log with Fastly logger multiplexing and Cloudflare tail worker support
…Fastly API compatibility

- Keep constructor overloading for compatibility with native Fastly CacheOverride API
- Simplify export pattern with both default and named exports for flexibility
- Fix circular reference issue with fetch export
- All tests passing (32 tests, 76% coverage on CacheOverride)

Addresses @tripodsan's review comments on constructor complexity and export patterns.

Signed-off-by: Lars Trieloff <lars@trieloff.net>
feat: export CacheOverride API for cross-platform cache control
@trieloff

Copy link
Copy Markdown
Contributor Author

@tripodsan I think we could try this. I've found myself often surprised by the missing history

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants