Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/github_get_issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
foreach( $org_github->getOrgs() as $org ) {
echo "Working with $org \n";

#try and limit this to 'eclipse' based projects, remove this to start working with locationtech etc.
if ( preg_match('/eclipse/',$org) !== 1 ){
echo "Not eclipse, skipping issues processing\n";
#only work with selected orgs based on the config file
if ( preg_match(GITHUB_ORG_REGEX,$github_organization) !== 1 ){

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this defined?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the config file. That allows us to expand the covered organizations without further code changes.

echo "Not a selected org, skipping \n";
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions bin/github_install_hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
foreach( $org_github->getOrgs() as $org ) {
echo "Working with $org \n";

#only work with Eclipse orgs. Remove this to work with locationtech etc.
if ( preg_match('/eclipse/',$org) !== 1 ){
echo "Not an Eclipse org, skipping \n";
#only work with selected orgs based on the config file
if ( preg_match(GITHUB_ORG_REGEX,$github_organization) !== 1 ){
echo "Not a selected org, skipping \n";
continue;
}

Expand Down
16 changes: 9 additions & 7 deletions bin/github_verify_committers.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
#load github org from team
$github_organization = $org_forge_team->getOrgName();
echo "GitHub Org: " . $github_organization . "\n";
#only work with Eclipse orgs, remove this to start handling locationtech etc.
if ( preg_match('/eclipse/',$github_organization) !== 1 ){
echo "Not an Eclipse org, skipping \n";
#only work with selected orgs based on the config file.
if ( preg_match(GITHUB_ORG_REGEX,$github_organization) !== 1 ){
echo "Not a selected org, skipping \n";
continue;
}

Expand Down Expand Up @@ -120,10 +120,12 @@
$githubResult = $org_github_team->getCommitterList();
$eclipseResult = $org_forge_team->getCommitterList();

//echo "Github members: \n";
//print_r($githubResult);
//echo "Eclipse members: \n";
//print_r($eclipseResult);
# if ( preg_match(GITHUB_ORG_REGEX,$github_organization) == 1 ) {
# echo "Github members: \n";
# print_r($githubResult);
# echo "Eclipse members: \n";
# print_r($eclipseResult);
# }

echo "\n[Info] checking $repoName...\n";
$toBeRemoved = compare($githubResult, $eclipseResult);
Expand Down
10 changes: 9 additions & 1 deletion lib/organization/eclipse.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ function __construct($debug) {
if ( $teamOrg === '' && $teamRepoOrg[0] !== '' ) {
if($this->debug) echo "Setting org name to: $teamOrg($teamRepoOrg[0]) \n";
$team->setOrgName($teamRepoOrg[0]);
#teamnames are important and need to be updated based on the org name in order for follow on processing to find them
#for 'sub' orgs(eclipse-ee4j) they should simply use the 'parent' org name for the first half of the team name
$orgNameParts= explode("-",$teamRepoOrg[0]);
if ( preg_match("/$orgNameParts[0]/",$teamName) !==1 ){

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does $ fly in preg_match for including variables? I thought it would need to be escaped.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs don't indicate that this isn't valid, and it does work. But I'll concede that may be a happy accident. Adding Chris, for comment

$teamName =preg_replace('/(.*)-(.*)/',"$orgNameParts[0]-$2",$teamName);
if($this->debug) echo "TeamName<>OrgName mismatch. Setting teamname to: $teamName \n";
$team->setTeamName($teamName);
}
} else if ( strcmp($teamRepoOrg[0],$teamOrg) !== 0 ) {
#this repo is in another org, which should be a no-no within a single project.
echo "[Error] $teamName has a repo in another org (got: $teamRepoOrg expected: $teamOrg.\n";
Expand All @@ -64,7 +72,7 @@ function __construct($debug) {
}
foreach($repoUserObj->users as $user) {
$team->addCommitter($user);
echo "Adding $user to $teamName \n";
if($this->debug) echo "Adding $user to $teamName \n";
}
}
else {
Expand Down
6 changes: 3 additions & 3 deletions lib/organization/github.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ function __construct($debug) {
array_push($this->GHOrgs,$github_organization);
if($this->debug) echo "In Github org loop, adding: $github_organization\n";

#limit the github org to eclipse. remove these to work with locationtech etc.
if ( preg_match("/eclipse/",$github_organization) !== 1) {
if($this->debug) echo "Not an Eclipse org, bypassing \n";
#limit the selected orgs to those from the config file.
if ( preg_match(GITHUB_ORG_REGEX,$github_organization) !== 1) {
if($this->debug) echo "Not a selected org, bypassing \n";
continue;
}
$this->debug = true;
Expand Down