[ Observatory ] Create fork of runtime/observatory at pkg/observatory

This change further prepares for the removal of Observatory from the
shipped Dart SDK by creating a fork to be used by the remaining
Observatory users.

This is basically a straight copy of the contents from
runtime/observatory with the exception of two new scripts:

- `bin/observatory.dart`, a utility to launch Observatory
- `bin/activate.dart`, which globally activates `bin/observatory.dart`
  as `observatory`

This change also updates the presubmits to ensure that
`runtime/observatory` is effectively placed in read-only mode to prevent
any divergences with the fork.

Work towards https://github.com/dart-lang/sdk/issues/50233

Change-Id: Iff3a7512058f36afa2a96d45d94a1dff424401d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429800
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Ben Konyi
2025-05-22 07:19:03 -07:00
committed by Commit Queue
parent b083c9ac87
commit d7cef28bee
284 changed files with 56469 additions and 1 deletions
+14
View File
@@ -537,6 +537,19 @@ def _CheckDartApiWinCSync(input_api, output_api):
return []
def _CheckNoRuntimeObservatoryChanges(input_api, output_api):
"""Ensures that no further changes are made to runtime/observatory."""
for f in input_api.AffectedFiles(include_deletes=False):
path = f.LocalPath()
if path.startswith("runtime/observatory/"):
return [
output_api.PresubmitError(
'Observatory is being moved to pkg/observatory. Files under '
'runtime/observatory should no longer be modified.')
]
return []
def _CommonChecks(input_api, output_api):
results = []
results.extend(_CheckValidHostsInDEPS(input_api, output_api))
@@ -552,6 +565,7 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckAnalyzerFiles(input_api, output_api))
results.extend(_CheckDevCompilerSync(input_api, output_api))
results.extend(_CheckDartApiWinCSync(input_api, output_api))
results.extend(_CheckNoRuntimeObservatoryChanges(input_api, output_api))
return results