Skip to content

Commit

Permalink
Add pull request template to sub packages (#876)
Browse files Browse the repository at this point in the history
* Add pull request template to sub packages

* Fix doc generator

* Fix copyright year
  • Loading branch information
jdpedrie authored and dwsupplee committed Jan 31, 2018
1 parent f3db719 commit d534eaa
Show file tree
Hide file tree
Showing 27 changed files with 620 additions and 1 deletion.
8 changes: 8 additions & 0 deletions dev/src/AddComponent/Command/AddComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Google\Cloud\Dev\AddComponent\Info;
use Google\Cloud\Dev\AddComponent\License;
use Google\Cloud\Dev\AddComponent\Manifest;
use Google\Cloud\Dev\AddComponent\PullRequestTemplate;
use Google\Cloud\Dev\AddComponent\QuestionTrait;
use Google\Cloud\Dev\AddComponent\Readmes;
use Google\Cloud\Dev\AddComponent\TableOfContents;
Expand Down Expand Up @@ -85,6 +86,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
'Creating CONTRIBUTING.md file by copying from template.'
));

$output->writeln($formatter->formatSection(
'Pull Request Template',
'Creating .github/pull_request_template.md file by copying from template.'
));

(new PullRequestTemplate($this->cliBasePath, $info['path']))->run();

(new Contributing($this->cliBasePath, $info['path']))->run();

$output->writeln($formatter->formatSection(
Expand Down
2 changes: 1 addition & 1 deletion dev/src/AddComponent/PathTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private function pathIsGapic($path)

private function scanDirectory($path, array $excludes = [])
{
$excludes = ['..', '.', '.DS_Store', 'VERSION', 'LICENSE', 'CONTRIBUTING.md'] + $excludes;
$excludes = ['..', '.', '.DS_Store', 'VERSION', 'LICENSE', 'CONTRIBUTING.md', '.github'] + $excludes;
return array_diff(scandir($path), $excludes);
}
}
55 changes: 55 additions & 0 deletions dev/src/AddComponent/PullRequestTemplate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* Copyright 2018 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace Google\Cloud\Dev\AddComponent;

/**
* Create pull request template file.
*/
class PullRequestTemplate
{
/**
* @var string
*/
private $cliBasePath;

/**
* @var string
*/
private $path;


public function __construct($cliBasePath, $path)
{
$this->cliBasePath = $cliBasePath;
$this->path = $path;
}

public function run()
{
$source = $this->cliBasePath . '/src/AddComponent/templates/template-pull_request_template.md.txt';
$dir = $this->path .'/.github';
$dest = $dir . '/pull_request_template.md';
@mkdir($dir);

$pathParts = explode('/', $this->path);
$template = file_get_contents($source);
$template = str_replace('{clientBase}', array_pop($pathParts), $template);

file_put_contents($dest, $template);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/{clientBase}`, and tests in `tests/*/{clientBase}`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
4 changes: 4 additions & 0 deletions dev/src/DocGenerator/DocGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public function generate($basePath, $pretty)
$this->isComponent
);
} else {
if (strpos($file, '.github') !== false) {
continue;
}

$content = file_get_contents($file);
$split = explode('src/', $file);
$parser = new MarkdownParser($split[1], $content);
Expand Down
24 changes: 24 additions & 0 deletions src/BigQuery/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/BigQuery`, and tests in `tests/*/BigQuery`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Bigtable/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Bigtable`, and tests in `tests/*/Bigtable`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Container/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Container`, and tests in `tests/*/Container`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Core/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Core`, and tests in `tests/*/Core`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Dataproc/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Dataproc`, and tests in `tests/*/Dataproc`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Datastore/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Datastore`, and tests in `tests/*/Datastore`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Debugger/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Debugger`, and tests in `tests/*/Debugger`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Dlp/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Dlp`, and tests in `tests/*/Dlp`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/ErrorReporting/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/ErrorReporting`, and tests in `tests/*/ErrorReporting`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Firestore/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Firestore`, and tests in `tests/*/Firestore`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
24 changes: 24 additions & 0 deletions src/Language/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**PLEASE READ THIS ENTIRE MESSAGE**

Hello, and thank you for your contribution! Please note that this repository is
a read-only split of `GoogleCloudPlatform/google-cloud-php`. As such, we are
unable to accept pull requests to this repository.

We welcome your pull request and would be happy to consider it for inclusion in
our library if you follow these steps:

* Clone the parent client library repository:

```sh
$ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Language`, and tests in `tests/*/Language`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).

Thanks again, and we look forward to seeing your proposed change!

The Google Cloud PHP team
Loading

0 comments on commit d534eaa

Please sign in to comment.