Skip to content

Commit c62eba9

Browse files
committed
Improve language
(issue googlefonts#176)
1 parent 5f389d4 commit c62eba9

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

containers/base/javascript/node/manifestSources/CSVSpreadsheet.js

+31-31
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* Currently we only use git repositories.
2020
*
21-
* In here, we don't have branch information yet, we use "master"
21+
* In here, we don't have branch information yet, we use "main"
2222
* as referenceName by default! We could include ":otherBranch" at the
2323
* end of "upstream" in the future.
2424
*
@@ -61,7 +61,7 @@ const MAX_PARALLEL_GIT_FETCHES = 1; // 8;
6161
/**
6262
* The sources are listed in a google docs spreadsheet.
6363
*/
64-
function CSVSpreadsheet(logging, id, reposPath, sheetCSVUrl, familyWhitelist
64+
function CSVSpreadsheet(logging, id, reposPath, sheetCSVUrl, familyAllowlist
6565
, reportsSetup) {
6666
this._log = logging;
6767
this._sheetCSVUrl = sheetCSVUrl;
@@ -72,10 +72,10 @@ function CSVSpreadsheet(logging, id, reposPath, sheetCSVUrl, familyWhitelist
7272
// anymore after an update?
7373
this._gitRepos = new Map();
7474
this.id = id;
75-
this._familyWhitelist = familyWhitelist;
75+
this._familyAllowlist = familyAllowlist;
7676
this._familyReportTable = null; // specific for this Source currently
7777
this._reposPath = reposPath;
78-
Parent.call(this, logging, id, familyWhitelist, reportsSetup);
78+
Parent.call(this, logging, id, familyAllowlist, reportsSetup);
7979
}
8080

8181
var _p = CSVSpreadsheet.prototype = Object.create(Parent.prototype);
@@ -187,7 +187,7 @@ var CSVFamily = (function() {
187187
, referenceName: {
188188
get: function() {
189189
if(this.repoType === 'git')
190-
return this.branch || 'master'; // default to master
190+
return this.branch || 'main'; // default to main
191191
// make this explicit if usable for other repo types
192192
throw new Error('"referenceName" not implemented for repoType: ' + this.repoType);
193193
}
@@ -702,12 +702,12 @@ _p._fetchGit = function(familyData) {
702702
});
703703
};
704704

705-
_p._fetchGoogleFontsMaster = function() {
705+
_p._fetchGoogleFontsMainBranch = function() {
706706
return this._fetchGit({
707-
name: 'Google Fonts GitHub Master'
707+
name: 'Google Fonts GitHub Main Branch'
708708
, remoteName: 'google/fonts'
709709
, remoteUrl: 'https://github.com/google/fonts.git'
710-
, referenceName: 'master'
710+
, referenceName: 'main'
711711
}); // -> git reference promise
712712
};
713713

@@ -740,8 +740,8 @@ function zip(...arrays) {
740740
return result;
741741
}
742742

743-
function _getMetadata(files, familyData, commit, tree, googleMasterFamilyTree) {
744-
var isUpdate = !!googleMasterFamilyTree
743+
function _getMetadata(files, familyData, commit, tree, googleMainBranchFamilyTree) {
744+
var isUpdate = !!googleMainBranchFamilyTree
745745
// Ideally the two cases yield the same result! However, existing
746746
// families may have directories violating the
747747
// {licenseDir}/{familyDirName} rule
@@ -752,7 +752,7 @@ function _getMetadata(files, familyData, commit, tree, googleMasterFamilyTree) {
752752
;
753753

754754
if(isUpdate) {
755-
targetDirectory = googleMasterFamilyTree.path();
755+
targetDirectory = googleMainBranchFamilyTree.path();
756756
// If this is the wrong licenseDir it's unlikely that
757757
// the dispatcher pipeline will work for the family.
758758
// At least the PR will end in the wrong place!
@@ -905,7 +905,7 @@ function findAllFilesEntriesInPath(rootTree, path, filterFunction) {
905905
}
906906

907907
_p._collectDataGit = function(familyData, commit, tree, rootTree
908-
, masterFamilyTree, filesPrefix) {
908+
, mainBranchFamilyTree, filesPrefix) {
909909
var files = new Map()
910910
, treeToFiles = (tree, filterFunc) => {
911911
return this._treeToFilesData(tree, filterFunc)
@@ -916,12 +916,12 @@ _p._collectDataGit = function(familyData, commit, tree, rootTree
916916
}
917917
;
918918

919-
// From masterFamilyTree: get all files, except the .ttf ones
919+
// From mainBranchFamilyTree: get all files, except the .ttf ones
920920
// that's e.g. OFL.txt and DESCRIPTION.en_us.html from the
921-
// google/fonts master.
922-
return (masterFamilyTree
921+
// google/fonts main branch.
922+
return (mainBranchFamilyTree
923923
// this may be null, e.g. if the family is a new addition
924-
? treeToFiles(masterFamilyTree, filename=>!filename.endsWith('.ttf'))
924+
? treeToFiles(mainBranchFamilyTree, filename=>!filename.endsWith('.ttf'))
925925
: Promise.resolve())
926926
// From tree: get all .ttf files starting with filesPrefix
927927
.then(()=>treeToFiles(tree, filename=>{
@@ -965,7 +965,7 @@ _p._collectDataGit = function(familyData, commit, tree, rootTree
965965
// that way we could update stuff using the dispatcher pipeline
966966
// without having to program rare exceptions.
967967
.then(()=>{
968-
var metadata = _getMetadata(files, familyData, commit, tree, masterFamilyTree);
968+
var metadata = _getMetadata(files, familyData, commit, tree, mainBranchFamilyTree);
969969
return this._insertMetadataPB(
970970
Array.from(files.entries()) // -> filesData
971971
, metadata
@@ -1007,15 +1007,15 @@ function _findTree(
10071007
);
10081008
}
10091009

1010-
_p._getGitMasterTreeForFamily = function(familyName) {
1011-
return this._fetchGoogleFontsMaster()
1010+
_p._getGitMainBranchTreeForFamily = function(familyName) {
1011+
return this._fetchGoogleFontsMainBranch()
10121012
.then(reference=>this._getCommit(reference.owner(), reference.target()))
10131013
.then(currentCommit=>_findTree(
10141014
currentCommit
10151015
, familyName.toLowerCase().replace(/ /g, '')/*familyDirName*/
10161016
, ['ofl', 'apache', 'ufl']/*licenseDirs*/))
10171017
.then(null, err=>{
1018-
this._log.info('Can\'t get ', familyName, 'tree from master:', err);
1018+
this._log.info('Can\'t get ', familyName, 'tree from main branch:', err);
10191019
return null;
10201020
});
10211021
};
@@ -1040,12 +1040,12 @@ _p._getGitData = function(familyData, reference) {
10401040
})
10411041
.then(_getTreeFromTreeEntry) // -> tree
10421042

1043-
, masterFamilyTreePromise = this._getGitMasterTreeForFamily(familyData.name)
1043+
, mainBranchFamilyTreePromise = this._getGitMainBranchTreeForFamily(familyData.name)
10441044
;
10451045

1046-
return Promise.all([familyData, commit, treePromise, rootTreePromise, masterFamilyTreePromise, filesPrefix]);
1046+
return Promise.all([familyData, commit, treePromise, rootTreePromise, mainBranchFamilyTreePromise, filesPrefix]);
10471047
})
1048-
// args = [familyData, commit, tree, rootTree, masterFamilyTree, filesPrefix]
1048+
// args = [familyData, commit, tree, rootTree, mainBranchFamilyTree, filesPrefix]
10491049
.then(args=>this._collectDataGit(...args))// -> [baseDir, filesData, metadata, path, familyName]
10501050
;
10511051
};
@@ -1088,11 +1088,11 @@ _p._update = function(csvData) {
10881088

10891089
for(let familyData of csvData.values()) {
10901090
let familyName = familyData.name;
1091-
if(this._familyWhitelist && !this._familyWhitelist.has(familyName)) {
1092-
// TODO: maybe only report the whitelist once.
1091+
if(this._familyAllowlist && !this._familyAllowlist.has(familyName)) {
1092+
// TODO: maybe only report the allowlist once.
10931093
// Much less noise! and it can be used as a tool to only update
10941094
// selected families (e.g. just one)
1095-
this._reportFamily(familyName,'skipped', 'Not whitelisted.');
1095+
this._reportFamily(familyName,'skipped', 'Not allowlisted.');
10961096
continue;
10971097
}
10981098
if(familyData.keySuffix){
@@ -1221,7 +1221,7 @@ _p.getSourceDetails = function(familyName) {
12211221

12221222
if (typeof require != 'undefined' && require.main==module) {
12231223
var setup = getSetup(), sources = [], server
1224-
, familyWhitelist = setup.develFamilyWhitelist
1224+
, familyAllowlist = setup.develFamilyAllowlist
12251225
// For development may contain /var/git-repositories/github.com_google_fonts.git
12261226
// /var/git-repositories$ git clone --bare https://github.com/google/fonts.git github.com_google_fonts.git
12271227
, repoPath = '/var/git-repositories'
@@ -1246,8 +1246,8 @@ if (typeof require != 'undefined' && require.main==module) {
12461246
}
12471247

12481248
setup.logging.log('Loglevel', setup.logging.loglevel);
1249-
if(familyWhitelist)
1250-
setup.logging.debug('FAMILY_WHITELIST:', familyWhitelist);
1249+
if(familyAllowlist)
1250+
setup.logging.debug('FAMILY_ALLOWLIST:', familyAllowlist);
12511251
// the prod api
12521252

12531253
// Could be used in local development to reduce environment complexity
@@ -1257,13 +1257,13 @@ if (typeof require != 'undefined' && require.main==module) {
12571257
// TODO: rename to production-upstream, but there are many places to
12581258
// do so!
12591259
sources.push(new CSVSpreadsheet(setup.logging, 'upstream', repoPath
1260-
, upstreamSheetCSVUrl, familyWhitelist, setup.reports));
1260+
, upstreamSheetCSVUrl, familyAllowlist, setup.reports));
12611261
// In sandbox mode, we allow feature branches as upstream sources
12621262
// I had the worry that there may be race conditions between the
12631263
// two sources, but it seems like this is solved via the queue which
12641264
// is shared by ManifestServer via the setQueue interface.
12651265
sources.push(new CSVSpreadsheet(setup.logging, 'sandbox-upstream', repoPath
1266-
, sanboxSheetCSVUrl, familyWhitelist, setup.reports));
1266+
, sanboxSheetCSVUrl, familyAllowlist, setup.reports));
12671267

12681268
// NOTE: this was used for development.
12691269
// let _queues = new Map()

docs/DEPLOYLOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ GITHUB_API_TOKEN=AAAAAAAAABBBBBBXXXXXX{PRIVATE}QQQZZZSSSSS
388388
GITHUB_OAUTH_CLIENT_ID=AAAAAAAAABBBBBBXXXXXX{PRIVATE}QQQZZZSSSSS
389389
GITHUB_OAUTH_CLIENT_SECRET=AAAAAAAAABBBBBBXXXXXX{PRIVATE}QQQZZZSSSSS
390390

391-
# whitelist user login names on github to have the role "engineer"
391+
# allowlist user login names on github to have the role "engineer"
392392
GITHUB_AUTH_ENGINEERS="[\"userlogina\", \"userloginb\", \"userloginc\"]"
393393
# did generate it like so: $ head -c 33 /dev/urandom | base64 --wrap=0 ;echo ''
394394
WEB_SERVER_COOKIE_SECRET=AAAAAAAAABBBBBBXXXXXX{PRIVATE}QQQZZZSSSSSSSS
@@ -461,7 +461,7 @@ kubectl create configmap env-config --from-literal=ENVIRONMENT_VERSION="$ENVIRON
461461
2. gcloud-rethinkdb-stage-2.yaml
462462
3. gcloud-fontbakery-storage-cache.yaml
463463
4. gcloud-fontbakery-worker-cleanup.yaml, gcloud-fontbakery-worker-checker.yaml,
464-
gcloud-fontbakery-worker-distributor.yaml, gcloud-fontbakery-manifest-master.yaml
464+
gcloud-fontbakery-worker-distributor.yaml, gcloud-fontbakery-manifest-main.yaml
465465
5. gcloud-fontbakery-api.yaml
466466
6. gcloud-fontbakery-manifest-gfapi.yaml
467467
7. gcloud-fontbakery-manifest-githubgf.yaml
@@ -499,7 +499,7 @@ kubectl apply -f kubernetes/gcloud-fontbakery-worker.yaml
499499
500500
kubectl apply -f kubernetes/gcloud-fontbakery-reports.yaml
501501
kubectl apply -f kubernetes/minikube-fontbakery-init-workers.yaml
502-
kubectl apply -f kubernetes/gcloud-fontbakery-manifest-master.yaml
502+
kubectl apply -f kubernetes/gcloud-fontbakery-manifest-main.yaml
503503
504504
kubectl apply -f kubernetes/minikube-fontbakery-github-auth.yaml
505505
kubectl apply -f kubernetes/minikube-fontbakery-github-operations.yaml
@@ -519,7 +519,7 @@ kubectl delete deployment fontbakery-worker-cleanup
519519
kubectl delete deployment fontbakery-worker-checker
520520
kubectl delete deployment fontbakery-worker-distributor
521521
kubectl delete deployment fontbakery-api
522-
kubectl delete deployment fontbakery-manifest-master
522+
kubectl delete deployment fontbakery-manifest-main
523523
524524
kubectl delete deployment fontbakery-manifest-gfapi
525525
kubectl delete deployment fontbakery-manifest-githubgf

0 commit comments

Comments
 (0)