18
18
*
19
19
* Currently we only use git repositories.
20
20
*
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 "
22
22
* as referenceName by default! We could include ":otherBranch" at the
23
23
* end of "upstream" in the future.
24
24
*
@@ -61,7 +61,7 @@ const MAX_PARALLEL_GIT_FETCHES = 1; // 8;
61
61
/**
62
62
* The sources are listed in a google docs spreadsheet.
63
63
*/
64
- function CSVSpreadsheet ( logging , id , reposPath , sheetCSVUrl , familyWhitelist
64
+ function CSVSpreadsheet ( logging , id , reposPath , sheetCSVUrl , familyAllowlist
65
65
, reportsSetup ) {
66
66
this . _log = logging ;
67
67
this . _sheetCSVUrl = sheetCSVUrl ;
@@ -72,10 +72,10 @@ function CSVSpreadsheet(logging, id, reposPath, sheetCSVUrl, familyWhitelist
72
72
// anymore after an update?
73
73
this . _gitRepos = new Map ( ) ;
74
74
this . id = id ;
75
- this . _familyWhitelist = familyWhitelist ;
75
+ this . _familyAllowlist = familyAllowlist ;
76
76
this . _familyReportTable = null ; // specific for this Source currently
77
77
this . _reposPath = reposPath ;
78
- Parent . call ( this , logging , id , familyWhitelist , reportsSetup ) ;
78
+ Parent . call ( this , logging , id , familyAllowlist , reportsSetup ) ;
79
79
}
80
80
81
81
var _p = CSVSpreadsheet . prototype = Object . create ( Parent . prototype ) ;
@@ -187,7 +187,7 @@ var CSVFamily = (function() {
187
187
, referenceName : {
188
188
get : function ( ) {
189
189
if ( this . repoType === 'git' )
190
- return this . branch || 'master ' ; // default to master
190
+ return this . branch || 'main ' ; // default to main
191
191
// make this explicit if usable for other repo types
192
192
throw new Error ( '"referenceName" not implemented for repoType: ' + this . repoType ) ;
193
193
}
@@ -702,12 +702,12 @@ _p._fetchGit = function(familyData) {
702
702
} ) ;
703
703
} ;
704
704
705
- _p . _fetchGoogleFontsMaster = function ( ) {
705
+ _p . _fetchGoogleFontsMainBranch = function ( ) {
706
706
return this . _fetchGit ( {
707
- name : 'Google Fonts GitHub Master '
707
+ name : 'Google Fonts GitHub Main Branch '
708
708
, remoteName : 'google/fonts'
709
709
, remoteUrl : 'https://github.com/google/fonts.git'
710
- , referenceName : 'master '
710
+ , referenceName : 'main '
711
711
} ) ; // -> git reference promise
712
712
} ;
713
713
@@ -740,8 +740,8 @@ function zip(...arrays) {
740
740
return result ;
741
741
}
742
742
743
- function _getMetadata ( files , familyData , commit , tree , googleMasterFamilyTree ) {
744
- var isUpdate = ! ! googleMasterFamilyTree
743
+ function _getMetadata ( files , familyData , commit , tree , googleMainBranchFamilyTree ) {
744
+ var isUpdate = ! ! googleMainBranchFamilyTree
745
745
// Ideally the two cases yield the same result! However, existing
746
746
// families may have directories violating the
747
747
// {licenseDir}/{familyDirName} rule
@@ -752,7 +752,7 @@ function _getMetadata(files, familyData, commit, tree, googleMasterFamilyTree) {
752
752
;
753
753
754
754
if ( isUpdate ) {
755
- targetDirectory = googleMasterFamilyTree . path ( ) ;
755
+ targetDirectory = googleMainBranchFamilyTree . path ( ) ;
756
756
// If this is the wrong licenseDir it's unlikely that
757
757
// the dispatcher pipeline will work for the family.
758
758
// At least the PR will end in the wrong place!
@@ -905,7 +905,7 @@ function findAllFilesEntriesInPath(rootTree, path, filterFunction) {
905
905
}
906
906
907
907
_p . _collectDataGit = function ( familyData , commit , tree , rootTree
908
- , masterFamilyTree , filesPrefix ) {
908
+ , mainBranchFamilyTree , filesPrefix ) {
909
909
var files = new Map ( )
910
910
, treeToFiles = ( tree , filterFunc ) => {
911
911
return this . _treeToFilesData ( tree , filterFunc )
@@ -916,12 +916,12 @@ _p._collectDataGit = function(familyData, commit, tree, rootTree
916
916
}
917
917
;
918
918
919
- // From masterFamilyTree : get all files, except the .ttf ones
919
+ // From mainBranchFamilyTree : get all files, except the .ttf ones
920
920
// 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
923
923
// 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' ) )
925
925
: Promise . resolve ( ) )
926
926
// From tree: get all .ttf files starting with filesPrefix
927
927
. then ( ( ) => treeToFiles ( tree , filename => {
@@ -965,7 +965,7 @@ _p._collectDataGit = function(familyData, commit, tree, rootTree
965
965
// that way we could update stuff using the dispatcher pipeline
966
966
// without having to program rare exceptions.
967
967
. then ( ( ) => {
968
- var metadata = _getMetadata ( files , familyData , commit , tree , masterFamilyTree ) ;
968
+ var metadata = _getMetadata ( files , familyData , commit , tree , mainBranchFamilyTree ) ;
969
969
return this . _insertMetadataPB (
970
970
Array . from ( files . entries ( ) ) // -> filesData
971
971
, metadata
@@ -1007,15 +1007,15 @@ function _findTree(
1007
1007
) ;
1008
1008
}
1009
1009
1010
- _p . _getGitMasterTreeForFamily = function ( familyName ) {
1011
- return this . _fetchGoogleFontsMaster ( )
1010
+ _p . _getGitMainBranchTreeForFamily = function ( familyName ) {
1011
+ return this . _fetchGoogleFontsMainBranch ( )
1012
1012
. then ( reference => this . _getCommit ( reference . owner ( ) , reference . target ( ) ) )
1013
1013
. then ( currentCommit => _findTree (
1014
1014
currentCommit
1015
1015
, familyName . toLowerCase ( ) . replace ( / / g, '' ) /*familyDirName*/
1016
1016
, [ 'ofl' , 'apache' , 'ufl' ] /*licenseDirs*/ ) )
1017
1017
. 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 ) ;
1019
1019
return null ;
1020
1020
} ) ;
1021
1021
} ;
@@ -1040,12 +1040,12 @@ _p._getGitData = function(familyData, reference) {
1040
1040
} )
1041
1041
. then ( _getTreeFromTreeEntry ) // -> tree
1042
1042
1043
- , masterFamilyTreePromise = this . _getGitMasterTreeForFamily ( familyData . name )
1043
+ , mainBranchFamilyTreePromise = this . _getGitMainBranchTreeForFamily ( familyData . name )
1044
1044
;
1045
1045
1046
- return Promise . all ( [ familyData , commit , treePromise , rootTreePromise , masterFamilyTreePromise , filesPrefix ] ) ;
1046
+ return Promise . all ( [ familyData , commit , treePromise , rootTreePromise , mainBranchFamilyTreePromise , filesPrefix ] ) ;
1047
1047
} )
1048
- // args = [familyData, commit, tree, rootTree, masterFamilyTree , filesPrefix]
1048
+ // args = [familyData, commit, tree, rootTree, mainBranchFamilyTree , filesPrefix]
1049
1049
. then ( args => this . _collectDataGit ( ...args ) ) // -> [baseDir, filesData, metadata, path, familyName]
1050
1050
;
1051
1051
} ;
@@ -1088,11 +1088,11 @@ _p._update = function(csvData) {
1088
1088
1089
1089
for ( let familyData of csvData . values ( ) ) {
1090
1090
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.
1093
1093
// Much less noise! and it can be used as a tool to only update
1094
1094
// selected families (e.g. just one)
1095
- this . _reportFamily ( familyName , 'skipped' , 'Not whitelisted .' ) ;
1095
+ this . _reportFamily ( familyName , 'skipped' , 'Not allowlisted .' ) ;
1096
1096
continue ;
1097
1097
}
1098
1098
if ( familyData . keySuffix ) {
@@ -1221,7 +1221,7 @@ _p.getSourceDetails = function(familyName) {
1221
1221
1222
1222
if ( typeof require != 'undefined' && require . main == module ) {
1223
1223
var setup = getSetup ( ) , sources = [ ] , server
1224
- , familyWhitelist = setup . develFamilyWhitelist
1224
+ , familyAllowlist = setup . develFamilyAllowlist
1225
1225
// For development may contain /var/git-repositories/github.com_google_fonts.git
1226
1226
// /var/git-repositories$ git clone --bare https://github.com/google/fonts.git github.com_google_fonts.git
1227
1227
, repoPath = '/var/git-repositories'
@@ -1246,8 +1246,8 @@ if (typeof require != 'undefined' && require.main==module) {
1246
1246
}
1247
1247
1248
1248
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 ) ;
1251
1251
// the prod api
1252
1252
1253
1253
// Could be used in local development to reduce environment complexity
@@ -1257,13 +1257,13 @@ if (typeof require != 'undefined' && require.main==module) {
1257
1257
// TODO: rename to production-upstream, but there are many places to
1258
1258
// do so!
1259
1259
sources . push ( new CSVSpreadsheet ( setup . logging , 'upstream' , repoPath
1260
- , upstreamSheetCSVUrl , familyWhitelist , setup . reports ) ) ;
1260
+ , upstreamSheetCSVUrl , familyAllowlist , setup . reports ) ) ;
1261
1261
// In sandbox mode, we allow feature branches as upstream sources
1262
1262
// I had the worry that there may be race conditions between the
1263
1263
// two sources, but it seems like this is solved via the queue which
1264
1264
// is shared by ManifestServer via the setQueue interface.
1265
1265
sources . push ( new CSVSpreadsheet ( setup . logging , 'sandbox-upstream' , repoPath
1266
- , sanboxSheetCSVUrl , familyWhitelist , setup . reports ) ) ;
1266
+ , sanboxSheetCSVUrl , familyAllowlist , setup . reports ) ) ;
1267
1267
1268
1268
// NOTE: this was used for development.
1269
1269
// let _queues = new Map()
0 commit comments