Skip to content

Commit 04337be

Browse files
authored
Merge branch 'master' into experiment
2 parents f26135b + 06fbedf commit 04337be

25 files changed

+200
-191
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ AppEngine version, listed here to ease deployment and troubleshooting.
33

44
## Next Release (replace with git tag when deployed)
55
* Enabled manual publishing settings on package admin UI.
6+
* Note: new `Package.publishingConfig` field in Datastore, new `PUT /api/packages/<package>/publishing` endpoint.
7+
* Note: Reverted public `cache-control` headers except for `/documentation/` pages.
68

79
## `20251023t081900-all`
810
* Bump runtimeVersion to `2025.10.22`.

app/lib/admin/backend.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import '../shared/versions.dart';
3535
import 'actions/actions.dart' show AdminAction;
3636
import 'tools/delete_all_staging.dart';
3737
import 'tools/list_tools.dart';
38-
import 'tools/notify_service.dart';
3938
import 'tools/recent_uploaders.dart';
4039
import 'tools/user_merger.dart';
4140

@@ -53,7 +52,6 @@ typedef Tool = Future<String> Function(List<String> args);
5352

5453
final Map<String, Tool> availableTools = {
5554
'delete-all-staging': executeDeleteAllStaging,
56-
'notify-service': executeNotifyService,
5755
'recent-uploaders': executeRecentUploaders,
5856
'user-merger': executeUserMergerTool,
5957
'list-tools': executeListTools,

app/lib/admin/tools/notify_service.dart

Lines changed: 0 additions & 28 deletions
This file was deleted.

app/lib/frontend/handlers/cache_control.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,13 @@ final class CacheControl {
6262
public: true,
6363
);
6464

65-
/// `Cache-Control` headers for package content pages, returning content that
65+
/// `Cache-Control` headers for documentation pages, returning content that
6666
/// is not updated frequently.
67-
static const packageContentPage = CacheControl(
67+
static const documentationPage = CacheControl(
6868
maxAge: Duration(minutes: 30),
6969
public: true,
7070
);
7171

72-
/// `Cache-Control` headers for package listing pages, returning content that
73-
/// is may be updated frequently.
74-
static const packageListingPage = CacheControl(
75-
maxAge: Duration(minutes: 5),
76-
public: true,
77-
);
78-
7972
/// `Cache-Control` headers for API end-points returning completion data for
8073
/// use in IDE integrations.
8174
static const completionData = CacheControl(

app/lib/frontend/handlers/landing.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import 'dart:async';
66

77
import 'package:_pub_shared/search/tags.dart';
8-
import 'package:pub_dev/frontend/handlers/cache_control.dart';
98
import 'package:pub_dev/search/top_packages.dart';
109
import 'package:shelf/shelf.dart' as shelf;
1110

@@ -50,10 +49,7 @@ Future<shelf.Response> indexLandingHandler(shelf.Request request) async {
5049
}
5150

5251
if (requestContext.uiCacheEnabled) {
53-
return htmlResponse(
54-
(await cache.uiIndexPage().get(_render))!,
55-
headers: CacheControl.packageListingPage.headers,
56-
);
52+
return htmlResponse((await cache.uiIndexPage().get(_render))!);
5753
}
5854
return htmlResponse(await _render());
5955
}

app/lib/frontend/handlers/listing.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import 'dart:async';
77
import 'package:_pub_shared/search/search_form.dart';
88
import 'package:_pub_shared/search/tags.dart';
99
import 'package:logging/logging.dart';
10-
import 'package:pub_dev/frontend/handlers/cache_control.dart';
11-
import 'package:pub_dev/frontend/request_context.dart';
1210
import 'package:shelf/shelf.dart' as shelf;
1311

1412
import '../../package/name_tracker.dart';
@@ -96,9 +94,6 @@ Future<shelf.Response> _packagesHandlerHtmlCore(shelf.Request request) async {
9694
openSections: openSections,
9795
),
9896
status: statusCode,
99-
headers: statusCode == 200 && requestContext.uiCacheEnabled
100-
? CacheControl.packageListingPage.headers
101-
: null,
10297
);
10398
_searchOverallLatencyTracker.add(sw.elapsed);
10499
return result;

app/lib/frontend/handlers/package.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,7 @@ Future<shelf.Response> _handlePackagePage({
356356
}
357357
_packageDoneLatencyTracker.add(sw.elapsed);
358358
}
359-
return htmlResponse(
360-
cachedPage,
361-
headers: cacheEnabled ? CacheControl.packageContentPage.headers : null,
362-
);
359+
return htmlResponse(cachedPage);
363360
}
364361

365362
/// Returns the optionally lowercased version of [name], but only if there

app/lib/frontend/handlers/pubapi.client.dart

Lines changed: 17 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/lib/frontend/handlers/pubapi.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,17 @@ class PubApi {
402402
) => putPackageOptionsHandler(request, package, body);
403403

404404
@EndPoint.put('/api/packages/<package>/automated-publishing')
405-
Future<AutomatedPublishingConfig> setAutomatedPublishing(
405+
Future<PkgPublishingConfig> setAutomatedPublishing(
406406
Request request,
407407
String package,
408-
AutomatedPublishingConfig body,
408+
PkgPublishingConfig body,
409+
) => packageBackend.setAutomatedPublishing(package, body);
410+
411+
@EndPoint.put('/api/packages/<package>/publishing')
412+
Future<PkgPublishingConfig> setPackagePublishing(
413+
Request request,
414+
String package,
415+
PkgPublishingConfig body,
409416
) => packageBackend.setAutomatedPublishing(package, body);
410417

411418
@EndPoint.get('/api/packages/<package>/versions/<version>/options')

app/lib/frontend/handlers/pubapi.g.dart

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)