Skip to content

fix(amplify-alpha): clarify GitHub repository configuration #34139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Jay2113
Copy link

@Jay2113 Jay2113 commented Apr 14, 2025

Issue # (if applicable)

Closes #25658.

Reason for this change

This PR addresses issue #25658 by improving the documentation for the AWS Amplify Alpha module to clarify how to properly configure GitHub repositories.

Description of changes

Enhanced documentation in SourceCodeProviderConfig to clearly explain the following:

  • The repository property should contain only the repository name, not the full URL
  • The full URL is constructed internally using the pattern: https://github.com/${owner}/${repository}
  • Updated documentation for both authentication methods:
    • Maintained both oauthToken (legacy) and accessToken (personal access token) for backward compatibility
    • Clarified that accessToken is the recommended method for GitHub repositories for feature parity with Amplify CreateApp API
    • Added recommendations to migrate to the GitHub App
  • Updated README examples to use more descriptive placeholder names:
    • Changed <user> to <github-username> for owner field
    • Changed <repo> to <repository-name> for repository field
    • Added comments in examples clarifying that only the repository name should be used
  • Fixed trailing spaces in documentation

These changes maintain backward compatibility while providing clearer guidance for new users, addressing the confusion that led to issue #25658.

Describe any new or updated permissions being added

N/A

Description of how you validated changes

Verified with example app that both authentication methods work as expected. Additionally, added a unit test for creating an app with access token.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team April 14, 2025 18:14
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Apr 14, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

@Jay2113 Jay2113 changed the title fix(aws-amplify-alpha): clarify GitHub repository configuration fix(amplify-alpha): clarify GitHub repository configuration Apr 14, 2025
Copy link

codecov bot commented Apr 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.00%. Comparing base (74cbe27) to head (bd47ebc).
Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #34139      +/-   ##
==========================================
+ Coverage   83.98%   84.00%   +0.01%     
==========================================
  Files         120      121       +1     
  Lines        6976     6984       +8     
  Branches     1178     1179       +1     
==========================================
+ Hits         5859     5867       +8     
  Misses       1005     1005              
  Partials      112      112              
Flag Coverage Δ
suite.unit 84.00% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 84.00% <ø> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 672fc04
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@Jay2113 Jay2113 requested a review from scottm-dev April 15, 2025 13:59
repository: '<repo>',
oauthToken: SecretValue.secretsManager('my-github-token'),
owner: '<github-username>',
repository: '<repository-name>', // Just the repository name, NOT the full repository URL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is alpha, so safer for breaking changes.
prop 'repository' is misleading as we see in the bug reported.

Cant we parse repository value passed and if it matches a github url use that or extract the repo-name from the url. Documentation is great but we can do the heavy lift here.

*
* Either `accessToken` or `oauthToken` must be specified if `repository`
* is sepcified.
* Either `accessToken` (GitHub) or `oauthToken` (other providers) must be specified
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a validation to assert this assumption?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-amplify): Documentation unclear about how to define repository
4 participants