Skip to content

Commit a5f29f9

Browse files
AleksanderBodurriAndrewKushnir
authored andcommitted
refactor(devtools): remove git sha stamping from devtools build (angular#55694)
This stamping is interfering with publishing to the Firefox addons store by brining in the entirety of the `.git` directory as part of the source code necessary for a reproducible build, which Firefox requires as part of it's approval process. In it's place, we are now using the extension version pulled from the manifest. PR Close angular#55694
1 parent b721e5d commit a5f29f9

File tree

9 files changed

+7
-30
lines changed

9 files changed

+7
-30
lines changed

devtools/projects/demo-standalone/src/BUILD.bazel

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ pkg_web(
7070
":bundle",
7171
"@npm//:node_modules/tslib/tslib.js",
7272
],
73-
# Currently, ibazel doesn't allow passing in flags to bazel run.
74-
# This means we are not able to use --config snapshot-build
75-
# to access the current commit SHA.
76-
# Since we still want to be able to use ibazel to speed up
77-
# local development, we supply an empty string for the SHA substitution.
78-
# This does not effect production builds.
79-
substitutions = {"BUILD_SCM_COMMIT_SHA": ""},
8073
)
8174

8275
http_server(

devtools/projects/demo-standalone/src/environments/environment.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88

99
export const environment = {
1010
production: false,
11-
LATEST_SHA: 'BUILD_SCM_COMMIT_SHA', // Stamped at build time by bazel
1211
};

devtools/projects/ng-devtools/src/lib/application-environment/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
interface Env {
10-
LATEST_SHA: string;
11-
}
12-
139
export interface Environment {
1410
production: boolean;
15-
LATEST_SHA: string;
1611
}
1712

1813
export const TOP_LEVEL_FRAME_ID = 0;

devtools/projects/ng-devtools/src/lib/devtools-tabs/devtools-tabs.component.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@
5151
</span>
5252
}
5353

54-
@if (latestSHA) {
55-
| DevTools SHA: {{ latestSHA }}
56-
}
54+
| DevTools: {{ extensionVersion }}
5755
</section>
5856
}
5957
</nav>

devtools/projects/ng-devtools/src/lib/devtools-tabs/devtools-tabs.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export class DevToolsTabsComponent implements OnInit, AfterViewInit {
9090
return parseInt(version.toString().split('.')[0], 10);
9191
});
9292

93+
extensionVersion = 'Development Build';
94+
9395
constructor(
9496
public tabUpdate: TabUpdate,
9597
public themeService: ThemeService,
@@ -111,6 +113,10 @@ export class DevToolsTabsComponent implements OnInit, AfterViewInit {
111113

112114
ngOnInit(): void {
113115
this.navbar.stretchTabs = false;
116+
117+
if (chrome !== undefined && chrome.runtime !== undefined) {
118+
this.extensionVersion = chrome.runtime.getManifest().version;
119+
}
114120
}
115121

116122
get tabs(): Tabs[] {
@@ -122,10 +128,6 @@ export class DevToolsTabsComponent implements OnInit, AfterViewInit {
122128
this.navbar.disablePagination = true;
123129
}
124130

125-
get latestSHA(): string {
126-
return this.applicationEnvironment.environment.LATEST_SHA.slice(0, 8);
127-
}
128-
129131
changeTab(tab: Tabs): void {
130132
this.activeTab = tab;
131133
this.tabUpdate.notify();

devtools/projects/shell-browser/src/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,4 @@ pkg_web(
151151
additional_root_paths = [
152152
"projects/ng-devtools/src/lib",
153153
],
154-
substitutions = {"BUILD_SCM_COMMIT_SHA": "{BUILD_SCM_COMMIT_SHA}"},
155154
)

devtools/projects/shell-browser/src/environments/environment.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88

99
export const environment = {
1010
production: true,
11-
LATEST_SHA: 'BUILD_SCM_COMMIT_SHA', // Stamped at build time by bazel
1211
};

devtools/src/BUILD.bazel

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@ pkg_web(
7373
":bundle",
7474
"@npm//:node_modules/tslib/tslib.js",
7575
],
76-
# Currently, ibazel doesn't allow passing in flags to bazel run.
77-
# This means we are not able to use --config snapshot-build
78-
# to access the current commit SHA.
79-
# Since we still want to be able to use ibazel to speed up
80-
# local development, we supply an empty string for the SHA substitution.
81-
# This does not effect production builds.
82-
substitutions = {"BUILD_SCM_COMMIT_SHA": ""},
8376
)
8477

8578
http_server(

devtools/src/environments/environment.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88

99
export const environment = {
1010
production: false,
11-
LATEST_SHA: 'BUILD_SCM_COMMIT_SHA', // Stamped at build time by bazel
1211
};

0 commit comments

Comments
 (0)