diff --git a/app/lib/account/agent.dart b/app/lib/account/agent.dart index 7b08fbc3bd..cbbe4790f1 100644 --- a/app/lib/account/agent.dart +++ b/app/lib/account/agent.dart @@ -25,7 +25,7 @@ abstract class KnownAgents { /// /// Deprecated and should not be used for new audit-log entries. /// This value is still present in some older audit-log entries. - static const _genericGithubActions = 'service:github-actions'; + static const _genericGitHubActions = 'service:github-actions'; /// Non-specific agent - only specifies it is from GCP Service Account. /// @@ -67,7 +67,7 @@ abstract class KnownAgents { ]; static const _nonSpecificAgentIds = { - _genericGithubActions, + _genericGitHubActions, _genericGcpServiceAccount, pubSupport, }; @@ -132,7 +132,7 @@ abstract class AuthenticatedAgent { /// Holds the authenticated GitHub Action information. /// /// The [agentId] has the following format: `service:github-actions:/` -class AuthenticatedGithubAction implements AuthenticatedAgent { +class AuthenticatedGitHubAction implements AuthenticatedAgent { @override late final agentId = KnownAgents.githubActionsAgentId( repositoryOwnerId: payload.repositoryOwnerId, @@ -140,7 +140,7 @@ class AuthenticatedGithubAction implements AuthenticatedAgent { ); @override - String get displayId => KnownAgents._genericGithubActions; + String get displayId => KnownAgents._genericGitHubActions; /// OIDC `id_token` the request was authenticated with. /// @@ -155,7 +155,7 @@ class AuthenticatedGithubAction implements AuthenticatedAgent { /// The parsed, GitHub-specific JWT payload. final GitHubJwtPayload payload; - AuthenticatedGithubAction({ + AuthenticatedGitHubAction({ required this.idToken, required this.payload, }) { diff --git a/app/lib/account/backend.dart b/app/lib/account/backend.dart index 1df9868b3b..f4a417b47e 100644 --- a/app/lib/account/backend.dart +++ b/app/lib/account/backend.dart @@ -170,7 +170,7 @@ Future _tryAuthenticateServiceAgent(String token) async { if (payload == null) { throw AuthenticationException.tokenInvalid('unable to parse payload'); } - return AuthenticatedGithubAction( + return AuthenticatedGitHubAction( idToken: idToken, payload: payload, ); diff --git a/app/lib/account/default_auth_provider.dart b/app/lib/account/default_auth_provider.dart index 77cf52d9df..9a8701cbce 100644 --- a/app/lib/account/default_auth_provider.dart +++ b/app/lib/account/default_auth_provider.dart @@ -207,7 +207,7 @@ abstract class BaseAuthProvider extends AuthProvider { if (idToken.payload.iss == GitHubJwtPayload.issuerUrl) { // The token claims to be issued by GitHub. If there is any problem // with the token, the authentication should fail without any fallback. - await _verifyToken(idToken, openIdDataFetch: fetchGithubOpenIdData); + await _verifyToken(idToken, openIdDataFetch: fetchGitHubOpenIdData); return idToken; } diff --git a/app/lib/audit/models.dart b/app/lib/audit/models.dart index 43437fe33e..66dae5a415 100644 --- a/app/lib/audit/models.dart +++ b/app/lib/audit/models.dart @@ -232,7 +232,7 @@ class AuditLogRecord extends db.ExpandoModel { static Map _dataForPublishing({ required AuthenticatedAgent uploader, }) { - if (uploader is AuthenticatedGithubAction) { + if (uploader is AuthenticatedGitHubAction) { final runId = uploader.payload.runId; final sha = uploader.payload.sha; return { @@ -256,7 +256,7 @@ class AuditLogRecord extends db.ExpandoModel { if (version != null) ' version `$version`', if (publisherId != null) ' owned by publisher `$publisherId`', ]; - if (uploader is AuthenticatedGithubAction) { + if (uploader is AuthenticatedGitHubAction) { final repository = uploader.payload.repository; final runId = uploader.payload.runId; final sha = uploader.payload.sha; diff --git a/app/lib/fake/backend/fake_auth_provider.dart b/app/lib/fake/backend/fake_auth_provider.dart index aa99ce9ece..c522faca7e 100644 --- a/app/lib/fake/backend/fake_auth_provider.dart +++ b/app/lib/fake/backend/fake_auth_provider.dart @@ -273,7 +273,7 @@ String _createGcpToken({ } @visibleForTesting -String createFakeGithubActionToken({ +String createFakeGitHubActionToken({ required String repository, required String ref, // `https://pub.dev` unless specified otherwise diff --git a/app/lib/frontend/templates/views/pkg/admin_page.dart b/app/lib/frontend/templates/views/pkg/admin_page.dart index 1da15346c5..0b61671cfc 100644 --- a/app/lib/frontend/templates/views/pkg/admin_page.dart +++ b/app/lib/frontend/templates/views/pkg/admin_page.dart @@ -267,7 +267,7 @@ d.Node packageAdminPageNode({ d.Node _automatedPublishing(Package package) { final github = package.automatedPublishing?.githubConfig; final gcp = package.automatedPublishing?.gcpConfig; - final isGithubEnabled = github?.isEnabled ?? false; + final isGitHubEnabled = github?.isEnabled ?? false; return d.fragment([ d.a(name: 'automated-publishing'), d.h2(text: 'Automated publishing'), @@ -281,13 +281,13 @@ d.Node _automatedPublishing(Package package) { child: material.checkbox( id: '-pkg-admin-automated-github-enabled', label: 'Enable publishing from GitHub Actions', - checked: isGithubEnabled, + checked: isGitHubEnabled, ), ), d.div( classes: [ '-pub-form-checkbox-indent', - if (!isGithubEnabled) '-pub-form-block-hidden', + if (!isGitHubEnabled) '-pub-form-block-hidden', ], children: [ d.div( @@ -368,7 +368,7 @@ d.Node _automatedPublishing(Package package) { value: github?.environment, ), ), - if (isGithubEnabled) _exampleGithubWorkflow(github!), + if (isGitHubEnabled) _exampleGitHubWorkflow(github!), ], ), d.a(name: 'google-cloud-service-account'), @@ -415,7 +415,7 @@ d.Node _automatedPublishing(Package package) { ]); } -d.Node _exampleGithubWorkflow(GithubPublishingConfig github) { +d.Node _exampleGitHubWorkflow(GitHubPublishingConfig github) { final expandedTagPattern = (github.tagPattern ?? '{{version}}') .replaceAll('{{version}}', '[0-9]+.[0-9]+.[0-9]+*'); final requireEnvironment = github.requireEnvironment; diff --git a/app/lib/package/backend.dart b/app/lib/package/backend.dart index 8eb5cf9f2c..60264070ea 100644 --- a/app/lib/package/backend.dart +++ b/app/lib/package/backend.dart @@ -58,11 +58,11 @@ final maxAssetContentLength = 256 * 1024; final _defaultMaxVersionsPerPackage = 1000; final Logger _logger = Logger('pub.cloud_repository'); -final _validGithubUserOrRepoRegExp = +final _validGitHubUserOrRepoRegExp = RegExp(r'^[a-z0-9\-\._]+$', caseSensitive: false); -final _validGithubVersionPattern = +final _validGitHubVersionPattern = RegExp(r'^[a-z0-9\-._]+$', caseSensitive: false); -final _validGithubEnvironment = +final _validGitHubEnvironment = RegExp(r'^[a-z0-9\-\._]+$', caseSensitive: false); /// Sets the package backend service. @@ -546,8 +546,8 @@ class PackageBackend { InvalidInputException.check(parts.length == 2, 'The `repository` field must follow the `/` pattern.'); InvalidInputException.check( - _validGithubUserOrRepoRegExp.hasMatch(parts[0]) && - _validGithubUserOrRepoRegExp.hasMatch(parts[1]), + _validGitHubUserOrRepoRegExp.hasMatch(parts[0]) && + _validGitHubUserOrRepoRegExp.hasMatch(parts[1]), 'The `repository` field has invalid characters.'); } @@ -557,7 +557,7 @@ class PackageBackend { InvalidInputException.check( tagPatternParts .where((e) => e.isNotEmpty) - .every(_validGithubVersionPattern.hasMatch), + .every(_validGitHubVersionPattern.hasMatch), 'The `tagPattern` field has invalid characters.'); InvalidInputException.check( @@ -566,7 +566,7 @@ class PackageBackend { if (environment.isNotEmpty) { InvalidInputException.check( - _validGithubEnvironment.hasMatch(environment), + _validGitHubEnvironment.hasMatch(environment), 'The `environment` field has invalid characters.'); } } @@ -1308,8 +1308,8 @@ class PackageBackend { await packageBackend.isPackageAdmin(package, agent.user.userId)) { return; } - if (agent is AuthenticatedGithubAction) { - await _checkGithubActionAllowed(agent, package, newVersion); + if (agent is AuthenticatedGitHubAction) { + await _checkGitHubActionAllowed(agent, package, newVersion); return; } if (agent is AuthenticatedGcpServiceAccount) { @@ -1323,7 +1323,7 @@ class PackageBackend { agent.displayId, package.name!); } - Future _checkGithubActionAllowed(AuthenticatedGithubAction agent, + Future _checkGitHubActionAllowed(AuthenticatedGitHubAction agent, Package package, String newVersion) async { final githubConfig = package.automatedPublishing?.githubConfig; final githubLock = package.automatedPublishing?.githubLock; @@ -1676,15 +1676,15 @@ class PackageBackend { Package package, AuthenticatedAgent agent) { final current = package.automatedPublishing; if (current == null) { - if (agent is AuthenticatedGithubAction || + if (agent is AuthenticatedGitHubAction || agent is AuthenticatedGcpServiceAccount) { // This should be unreachable throw AssertionError('Authentication should never have been possible'); } return; } - if (agent is AuthenticatedGithubAction && current.githubLock == null) { - current.githubLock = GithubPublishingLock( + if (agent is AuthenticatedGitHubAction && current.githubLock == null) { + current.githubLock = GitHubPublishingLock( repositoryOwnerId: agent.payload.repositoryOwnerId, repositoryId: agent.payload.repositoryId, ); diff --git a/app/lib/package/models.dart b/app/lib/package/models.dart index 89c10e598c..16b07ae000 100644 --- a/app/lib/package/models.dart +++ b/app/lib/package/models.dart @@ -473,8 +473,8 @@ class Release { @JsonSerializable(explicitToJson: true, includeIfNull: false) class AutomatedPublishing { - GithubPublishingConfig? githubConfig; - GithubPublishingLock? githubLock; + GitHubPublishingConfig? githubConfig; + GitHubPublishingLock? githubLock; GcpPublishingConfig? gcpConfig; GcpPublishingLock? gcpLock; @@ -524,19 +524,19 @@ class AutomatedPublishingProperty extends db.Property { } @JsonSerializable(explicitToJson: true, includeIfNull: false) -class GithubPublishingLock { +class GitHubPublishingLock { final String repositoryOwnerId; final String repositoryId; - GithubPublishingLock({ + GitHubPublishingLock({ required this.repositoryOwnerId, required this.repositoryId, }); - factory GithubPublishingLock.fromJson(Map json) => - _$GithubPublishingLockFromJson(json); + factory GitHubPublishingLock.fromJson(Map json) => + _$GitHubPublishingLockFromJson(json); - Map toJson() => _$GithubPublishingLockToJson(this); + Map toJson() => _$GitHubPublishingLockToJson(this); } @JsonSerializable(explicitToJson: true, includeIfNull: false) diff --git a/app/lib/package/models.g.dart b/app/lib/package/models.g.dart index 52c6b332b5..ab8b1b7f74 100644 --- a/app/lib/package/models.g.dart +++ b/app/lib/package/models.g.dart @@ -38,11 +38,11 @@ AutomatedPublishing _$AutomatedPublishingFromJson(Map json) => AutomatedPublishing( githubConfig: json['githubConfig'] == null ? null - : GithubPublishingConfig.fromJson( + : GitHubPublishingConfig.fromJson( json['githubConfig'] as Map), githubLock: json['githubLock'] == null ? null - : GithubPublishingLock.fromJson( + : GitHubPublishingLock.fromJson( json['githubLock'] as Map), gcpConfig: json['gcpConfig'] == null ? null @@ -69,15 +69,15 @@ Map _$AutomatedPublishingToJson(AutomatedPublishing instance) { return val; } -GithubPublishingLock _$GithubPublishingLockFromJson( +GitHubPublishingLock _$GitHubPublishingLockFromJson( Map json) => - GithubPublishingLock( + GitHubPublishingLock( repositoryOwnerId: json['repositoryOwnerId'] as String, repositoryId: json['repositoryId'] as String, ); -Map _$GithubPublishingLockToJson( - GithubPublishingLock instance) => +Map _$GitHubPublishingLockToJson( + GitHubPublishingLock instance) => { 'repositoryOwnerId': instance.repositoryOwnerId, 'repositoryId': instance.repositoryId, diff --git a/app/lib/service/openid/github_openid.dart b/app/lib/service/openid/github_openid.dart index ab142c94e6..a1f88038dc 100644 --- a/app/lib/service/openid/github_openid.dart +++ b/app/lib/service/openid/github_openid.dart @@ -14,7 +14,7 @@ import 'openid_utils.dart'; final _logger = Logger('github_openid'); /// Fetches the OpenID configuration and then the JSON Web Key list from GitHub. -Future fetchGithubOpenIdData() async { +Future fetchGitHubOpenIdData() async { final githubUrl = 'https://token.actions.githubusercontent.com/.well-known/openid-configuration'; final list = await cache diff --git a/app/test/audit/backend_test.dart b/app/test/audit/backend_test.dart index fb6c57df00..7da9d7ce1b 100644 --- a/app/test/audit/backend_test.dart +++ b/app/test/audit/backend_test.dart @@ -85,7 +85,7 @@ void main() { created: clock.now(), package: 'pkg', version: '1.2.0', - uploader: AuthenticatedGithubAction( + uploader: AuthenticatedGitHubAction( idToken: token, payload: GitHubJwtPayload(token.payload), ), diff --git a/app/test/package/automated_publishing_test.dart b/app/test/package/automated_publishing_test.dart index b76672b910..3ded5ef0ab 100644 --- a/app/test/package/automated_publishing_test.dart +++ b/app/test/package/automated_publishing_test.dart @@ -47,7 +47,7 @@ void main() { final rs = await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'dart-lang/pub-dev', tagPattern: '{{version}}', @@ -123,7 +123,7 @@ void main() { final rs = client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: repository.isEmpty, repository: repository, tagPattern: '{{version}}', @@ -151,7 +151,7 @@ void main() { final rs = client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: false, repository: 'abcd/efgh', tagPattern: pattern, @@ -177,7 +177,7 @@ void main() { final rs = client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: false, repository: 'abcd/efgh', tagPattern: '{{version}}', @@ -200,7 +200,7 @@ void main() { final rs = client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: false, repository: 'abcd/efgh', isPushEventEnabled: false, diff --git a/app/test/package/upload_test.dart b/app/test/package/upload_test.dart index 32e5f46a36..d1f851fd63 100644 --- a/app/test/package/upload_test.dart +++ b/app/test/package/upload_test.dart @@ -375,7 +375,7 @@ void main() { group('Uploading with GitHub Actions', () { testWithProfile('GitHub Actions cannot upload new package', fn: () async { - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'x/y', ref: 'refs/tag/1', ); @@ -395,7 +395,7 @@ void main() { testWithProfile( 'GitHub Actions cannot upload new version to existing package', fn: () async { - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'x/y', ref: 'refs/tag/1', ); @@ -420,7 +420,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -429,7 +429,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'x/y', ref: 'refs/tag/1', ); @@ -455,7 +455,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -464,7 +464,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/unknown-ref-type/1', ); @@ -490,7 +490,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -499,7 +499,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/1', ); @@ -526,7 +526,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -535,7 +535,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', eventName: 'workflow_dispatch', @@ -561,7 +561,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -570,7 +570,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', eventName: 'unknown_event', @@ -597,7 +597,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -607,7 +607,7 @@ void main() { }, ); final pkg = await packageBackend.lookupPackage('oxygen'); - pkg!.automatedPublishing!.githubLock = GithubPublishingLock( + pkg!.automatedPublishing!.githubLock = GitHubPublishingLock( repositoryOwnerId: 'x', repositoryId: 'y', ); @@ -615,13 +615,13 @@ void main() { } final badTokens = [ - createFakeGithubActionToken( + createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', repositoryId: 'x2', repositoryOwnerId: 'y', ), - createFakeGithubActionToken( + createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', repositoryId: 'x', @@ -663,7 +663,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -672,7 +672,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', ); @@ -692,7 +692,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -703,7 +703,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', eventName: 'workflow_dispatch', @@ -730,7 +730,7 @@ void main() { await client.setAutomatedPublishing( '_dummy_pkg', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -739,7 +739,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', repositoryId: 'repo-id-1', @@ -803,7 +803,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -814,7 +814,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', ); @@ -841,7 +841,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: '{{version}}', @@ -852,7 +852,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/2.2.0', environment: 'staging', @@ -880,7 +880,7 @@ void main() { await client.setAutomatedPublishing( 'oxygen', AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: true, repository: 'a/b', tagPattern: 'v{{version}}', @@ -891,7 +891,7 @@ void main() { ); }, ); - final token = createFakeGithubActionToken( + final token = createFakeGitHubActionToken( repository: 'a/b', ref: 'refs/tags/v2.2.0', environment: 'prod', diff --git a/app/test/service/openid/github_actions_id_token_test.dart b/app/test/service/openid/github_actions_id_token_test.dart index d4e6984168..67b3dfa226 100644 --- a/app/test/service/openid/github_actions_id_token_test.dart +++ b/app/test/service/openid/github_actions_id_token_test.dart @@ -55,7 +55,7 @@ void main() { final token = JsonWebToken.parse(tokenValue); // verify signature - final githubData = await fetchGithubOpenIdData(); + final githubData = await fetchGitHubOpenIdData(); expect(await token.verifySignature(githubData.jwks), isTrue); // verify headers diff --git a/app/test/service/openid/github_openid_test.dart b/app/test/service/openid/github_openid_test.dart index 4ccee35340..12e0a891dd 100644 --- a/app/test/service/openid/github_openid_test.dart +++ b/app/test/service/openid/github_openid_test.dart @@ -13,7 +13,7 @@ import 'jwt_test.dart'; void main() { testWithProfile('GitHub key list', fn: () async { - final data = await fetchGithubOpenIdData(); + final data = await fetchGitHubOpenIdData(); expect(data.provider.issuer, 'https://token.actions.githubusercontent.com'); expect(data.provider.claimsSupported, containsAll(GitHubJwtPayload.requiredClaims)); diff --git a/pkg/_pub_shared/lib/data/package_api.dart b/pkg/_pub_shared/lib/data/package_api.dart index fddeeee259..45255d16d8 100644 --- a/pkg/_pub_shared/lib/data/package_api.dart +++ b/pkg/_pub_shared/lib/data/package_api.dart @@ -51,7 +51,7 @@ class PkgOptions { /// The configuration for a package's credential-less publishing. @JsonSerializable(includeIfNull: false, explicitToJson: true) class AutomatedPublishingConfig { - final GithubPublishingConfig? github; + final GitHubPublishingConfig? github; final GcpPublishingConfig? gcp; AutomatedPublishingConfig({ @@ -66,7 +66,7 @@ class AutomatedPublishingConfig { } @JsonSerializable(includeIfNull: false, explicitToJson: true) -class GithubPublishingConfig { +class GitHubPublishingConfig { bool isEnabled; /// The `owner/repository` path of the project on github.com. @@ -96,7 +96,7 @@ class GithubPublishingConfig { /// Whether the `workflow_dispatch` event is enabled. bool isWorkflowDispatchEventEnabled; - GithubPublishingConfig({ + GitHubPublishingConfig({ this.isEnabled = false, this.repository, this.tagPattern, @@ -111,10 +111,10 @@ class GithubPublishingConfig { this.isWorkflowDispatchEventEnabled = false, }); - factory GithubPublishingConfig.fromJson(Map json) => - _$GithubPublishingConfigFromJson(json); + factory GitHubPublishingConfig.fromJson(Map json) => + _$GitHubPublishingConfigFromJson(json); - Map toJson() => _$GithubPublishingConfigToJson(this); + Map toJson() => _$GitHubPublishingConfigToJson(this); } @JsonSerializable(includeIfNull: false, explicitToJson: true) diff --git a/pkg/_pub_shared/lib/data/package_api.g.dart b/pkg/_pub_shared/lib/data/package_api.g.dart index 43e14661f0..63f29dec69 100644 --- a/pkg/_pub_shared/lib/data/package_api.g.dart +++ b/pkg/_pub_shared/lib/data/package_api.g.dart @@ -37,7 +37,7 @@ AutomatedPublishingConfig _$AutomatedPublishingConfigFromJson( AutomatedPublishingConfig( github: json['github'] == null ? null - : GithubPublishingConfig.fromJson( + : GitHubPublishingConfig.fromJson( json['github'] as Map), gcp: json['gcp'] == null ? null @@ -59,9 +59,9 @@ Map _$AutomatedPublishingConfigToJson( return val; } -GithubPublishingConfig _$GithubPublishingConfigFromJson( +GitHubPublishingConfig _$GitHubPublishingConfigFromJson( Map json) => - GithubPublishingConfig( + GitHubPublishingConfig( isEnabled: json['isEnabled'] as bool? ?? false, repository: json['repository'] as String?, tagPattern: json['tagPattern'] as String?, @@ -72,8 +72,8 @@ GithubPublishingConfig _$GithubPublishingConfigFromJson( json['isWorkflowDispatchEventEnabled'] as bool? ?? false, ); -Map _$GithubPublishingConfigToJson( - GithubPublishingConfig instance) { +Map _$GitHubPublishingConfigToJson( + GitHubPublishingConfig instance) { final val = { 'isEnabled': instance.isEnabled, }; diff --git a/pkg/web_app/lib/src/admin_pages.dart b/pkg/web_app/lib/src/admin_pages.dart index f1c019f5c2..269f63b19d 100644 --- a/pkg/web_app/lib/src/admin_pages.dart +++ b/pkg/web_app/lib/src/admin_pages.dart @@ -174,7 +174,7 @@ class _PkgAdminWidget { await api_client.client.setAutomatedPublishing( pageData.pkgData!.package, AutomatedPublishingConfig( - github: GithubPublishingConfig( + github: GitHubPublishingConfig( isEnabled: githubEnabledCheckbox!.checked ?? false, repository: githubRepositoryInput.value, tagPattern: githubTagPatternInput!.value,