Skip to content

Backend Modernization: Update Dependencies and CI/CD #160

@lakshayman

Description

@lakshayman

Issue Description

The backend repository (feature-flag-backend) is currently using outdated dependencies and deprecated tooling. The project relies on AWS SDK Go v1, which has been deprecated by AWS, and uses Go 1.20 when Go 1.25.1 is available. Additionally, the CI/CD pipeline contains deprecated GitHub Actions that may break in future updates.

This issue focuses on:

  • Migrating from AWS SDK Go v1 (deprecated) to AWS SDK Go v2 (current)
  • Updating Go version from 1.20 to 1.25.1 across all modules
  • Updating safe backend dependencies to latest versions
  • Modernizing the backend CI/CD pipeline by replacing deprecated actions
  • Adding missing test execution to the CI pipeline

This is primarily a modernization task with dependency updates and CI/CD improvements. All changes will be tested thoroughly before merging.

Scope & Objectives

🔄 1. Go Version and Dependency Updates

Update Go version from 1.20 to 1.25.1 across all go.mod files (main module + 12 Lambda functions).

Upgrade safe dependencies:

  • github.com/aws/aws-lambda-go: v1.40.0 → v1.50.0
  • github.com/golang-jwt/jwt/v5: v5.2.1 → v5.3.0
  • Update indirect dependencies via go mod tidy

Verify all builds, tests, and Lambda functions work correctly after updates.

🚀 2. AWS SDK v1 → v2 Migration

Migrate from deprecated github.com/aws/aws-sdk-go v1 to github.com/aws/aws-sdk-go-v2.

Update DynamoDB client usage across:

  • database/dynamodb.go
  • All Lambda functions using DynamoDB (8 functions total)

Review AWS SDK v2 migration guide and update code to use new API patterns.

Ensure all DynamoDB operations continue to work correctly with the new SDK.

⚙️ 3. Backend CI/CD Modernization

Update deprecated GitHub Actions in .github/workflows/pipeline.yaml:

  • Replace actions/setup-python@v2 with actions/setup-python@v5
  • Fix deprecated ::set-output syntax to use $GITHUB_OUTPUT
  • Check and update other AWS-related actions if newer versions available

Add test execution step to CI pipeline (currently missing).

Optionally add linting step using golangci-lint for code quality consistency.

✅ 4. Testing and Verification

Ensure all Lambda functions build successfully with sam build.

Verify all tests pass with go test ./....

Test Lambda functions locally using sam local start-api.

Validate CI/CD pipeline runs successfully with all changes.

Expected Outcomes

✔️ Modernized Dependencies

  • Go version updated to 1.25.1 across all modules
  • AWS SDK migrated from deprecated v1 to current v2
  • All safe dependency updates applied
  • Indirect dependencies updated to latest compatible versions

✔️ Improved CI/CD Pipeline

  • All deprecated GitHub Actions replaced with current versions
  • Test execution added to CI pipeline
  • No warnings about deprecated syntax or actions
  • Pipeline runs successfully with all updates

✔️ Code Quality

  • All Lambda functions functional with AWS SDK v2
  • All tests passing
  • No breaking changes in API behavior
  • Code follows current best practices

✔️ Documentation

  • Migration notes documented if needed
  • Updated dependency versions reflected in go.mod files
  • CI/CD changes documented in workflow files

Notes

  • AWS SDK v2 has different API patterns than v1 - code changes are required
  • Go 1.25.1 maintains backward compatibility, so minimal risk
  • All changes should be tested locally before pushing
  • Consider deploying to staging environment before production
  • Major breaking changes should be reviewed carefully

Checklist

Go Version and Dependencies

  • Update Go version to 1.25.1 in all go.mod files (13 files total)
  • Update aws-lambda-go to v1.50.0
  • Update golang-jwt/jwt/v5 to v5.3.0
  • Run go mod tidy to update indirect dependencies
  • Verify all Lambda functions build with sam build
  • Run all tests with go test ./...
  • Check for issues with go vet ./...

AWS SDK Migration

  • Review AWS SDK v2 migration guide
  • Update go.mod to use AWS SDK v2
  • Update database/dynamodb.go for new SDK
  • Update all Lambda functions using DynamoDB (8 functions)
  • Test all Lambda functions locally
  • Verify all DynamoDB operations work correctly
  • Run integration tests
  • Code review for SDK migration changes

CI/CD Updates

  • Update actions/setup-python@v2 to v5
  • Replace ::set-output syntax with $GITHUB_OUTPUT
  • Check and update other GitHub Actions if needed
  • Add test execution step to CI pipeline
  • (Optional) Add linting step to CI pipeline
  • Verify CI pipeline runs successfully
  • Test deployment process

Final Verification

  • All builds succeed
  • All tests pass
  • CI pipeline passes
  • Local testing completed
  • Code review completed
  • Ready for merge

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions