You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/06 18:48:40 UTC

[GitHub] [beam] damccorm opened a new pull request, #21725: Daily p0/p1/flaky reports for issues

damccorm opened a new pull request, #21725:
URL: https://github.com/apache/beam/pull/21725

   This creates an analagous version of the P0/P1/flaky test reports that are currently created for Jira. Example - https://lists.apache.org/thread/dd58ogflz2sdhk6124g0hfycqcdox8c9
   
   Before this is merged, secrets need to be added to enable this flow. Specifically, the following secrets should be added:
   
   - ISSUE_REPORT_SENDER_EMAIL_ADDRESS: The email of the current (or new) bot
   - ISSUE_REPORT_SENDER_EMAIL_PASSWORD: The password of the bot. This needs to be an [app password](https://support.google.com/accounts/answer/185833?hl=en) if Gmail (if not Gmail then we need to update the config)
   
   Once this is merged and working, we should disable the Jira version
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`).
    - [ ] Add a link to the appropriate issue in your description, if applicable. This will automatically link the pull request to the issue.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
   
   To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   GitHub Actions Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] damccorm commented on a diff in pull request #21725: Daily p0/p1/flaky reports for issues

Posted by GitBox <gi...@apache.org>.
damccorm commented on code in PR #21725:
URL: https://github.com/apache/beam/pull/21725#discussion_r892535300


##########
scripts/ci/issue-report/generateReport.js:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+const { Octokit } = require("@octokit/rest");
+const nodemailer = require('nodemailer');
+
+function sendReport(title, header, issues) {
+    if (!issues || issues.length == 0) {
+        return;
+    }
+    let report = header + "\n\n"
+    for (const issue of issues) {
+        report += `${issue.url}: ${issue.title}\n`;
+    }
+      
+      nodemailer.createTransport({
+        service: process.env['ISSUE_REPORT_SENDER_EMAIL_SERVICE'], // e.g. "gmail"
+        auth: {
+          user: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+          pass: process.env['ISSUE_REPORT_SENDER_EMAIL_PASSWORD']
+        }
+      }).sendMail({
+        from: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+        to: process.env['ISSUE_REPORT_RECIPIENT_EMAIL_ADDRESS'],
+        subject: title,
+        text: report
+      }, function(error, info){
+        if (error) {
+          console.log(error);

Review Comment:
   I updated to an error which will turn the action red and notify the person who merges (I think). It should be more discoverable at least.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] asf-ci commented on pull request #21725: Daily p0/p1/flaky reports for issues

Posted by GitBox <gi...@apache.org>.
asf-ci commented on PR #21725:
URL: https://github.com/apache/beam/pull/21725#issuecomment-1147773153

   Can one of the admins verify this patch?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] kennknowles merged pull request #21725: Daily p0/p1/flaky reports for issues

Posted by GitBox <gi...@apache.org>.
kennknowles merged PR #21725:
URL: https://github.com/apache/beam/pull/21725


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] damccorm commented on a diff in pull request #21725: Daily p0/p1/flaky reports for issues

Posted by GitBox <gi...@apache.org>.
damccorm commented on code in PR #21725:
URL: https://github.com/apache/beam/pull/21725#discussion_r892534341


##########
scripts/ci/issue-report/generateReport.js:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+const { Octokit } = require("@octokit/rest");
+const nodemailer = require('nodemailer');
+
+function sendReport(title, header, issues) {
+    if (!issues || issues.length == 0) {
+        return;
+    }
+    let report = header + "\n\n"
+    for (const issue of issues) {
+        report += `${issue.url}: ${issue.title}\n`;
+    }
+      
+      nodemailer.createTransport({
+        service: process.env['ISSUE_REPORT_SENDER_EMAIL_SERVICE'], // e.g. "gmail"
+        auth: {
+          user: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+          pass: process.env['ISSUE_REPORT_SENDER_EMAIL_PASSWORD']
+        }
+      }).sendMail({
+        from: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+        to: process.env['ISSUE_REPORT_RECIPIENT_EMAIL_ADDRESS'],
+        subject: title,
+        text: report
+      }, function(error, info){
+        if (error) {
+          console.log(error);
+        } else {
+          console.log('Email sent: ' + info.response);

Review Comment:
   Yeah, this just logs to the console. I updated the above to an error which will fail the action. That should notify whoever merges the action I believe, but it will also just show up red and be easy to find if we notice we haven't gotten emails for a while.



##########
scripts/ci/issue-report/generateReport.js:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+const { Octokit } = require("@octokit/rest");
+const nodemailer = require('nodemailer');
+
+function sendReport(title, header, issues) {
+    if (!issues || issues.length == 0) {
+        return;
+    }
+    let report = header + "\n\n"
+    for (const issue of issues) {
+        report += `${issue.url}: ${issue.title}\n`;
+    }
+      
+      nodemailer.createTransport({
+        service: process.env['ISSUE_REPORT_SENDER_EMAIL_SERVICE'], // e.g. "gmail"
+        auth: {
+          user: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+          pass: process.env['ISSUE_REPORT_SENDER_EMAIL_PASSWORD']
+        }
+      }).sendMail({
+        from: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+        to: process.env['ISSUE_REPORT_RECIPIENT_EMAIL_ADDRESS'],
+        subject: title,
+        text: report
+      }, function(error, info){
+        if (error) {
+          console.log(error);
+        } else {
+          console.log('Email sent: ' + info.response);
+        }
+      });
+}
+
+async function generateReport() {
+    const octokit = new Octokit({});
+
+    let p0Issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
+    owner: 'apache',
+    repo: 'beam',
+    labels: 'P0'
+    });
+    p0Issues = p0Issues.filter(i => {
+        for (const l of i.labels) {
+            if (l.name == "flaky") {
+                return false;
+            }
+        }
+        return true;
+    });
+    let p0Header = `This is your daily summary of Beam's current P0 issues, not including flaky tests.
+
+    See https://beam.apache.org/contribute/issue-priorities/#p0-outage for the meaning and expectations around P0 issues.
+
+`;
+    sendReport(`P0 issues report (${p0Issues.length})`, p0Header, p0Issues);
+
+    let p1Issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
+    owner: 'apache',
+    repo: 'beam',
+    labels: 'P1'
+    });
+    p1Issues = p1Issues.filter(i => {
+        for (const l of i.labels) {
+            if (l.name == "flaky") {
+                return false;
+            }
+        }
+        return true;
+    });
+    let p1Header = `This is your daily summary of Beam's current P1 issues, not including flaky tests.
+
+    See https://beam.apache.org/contribute/issue-priorities/#p1-critical for the meaning and expectations around P1 issues.
+
+`;
+    sendReport(`P1 issues report (${p1Issues.length})`, p1Header, p1Issues);
+
+    let flakyIssues = await octokit.paginate(octokit.rest.issues.listForRepo, {
+    owner: 'apache',
+    repo: 'beam',
+    labels: 'flaky'

Review Comment:
   Labels should be locked down which will keep us from running into issues here - a committer would have to explicitly create a new label instead of choosing the existing one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] asf-ci commented on pull request #21725: Daily p0/p1/flaky reports for issues

Posted by GitBox <gi...@apache.org>.
asf-ci commented on PR #21725:
URL: https://github.com/apache/beam/pull/21725#issuecomment-1147773151

   Can one of the admins verify this patch?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] damccorm commented on pull request #21725: Daily p0/p1/flaky reports for issues

Posted by GitBox <gi...@apache.org>.
damccorm commented on PR #21725:
URL: https://github.com/apache/beam/pull/21725#issuecomment-1147857040

   R: @kennknowles 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] kennknowles commented on a diff in pull request #21725: Daily p0/p1/flaky reports for issues

Posted by GitBox <gi...@apache.org>.
kennknowles commented on code in PR #21725:
URL: https://github.com/apache/beam/pull/21725#discussion_r892523781


##########
scripts/ci/issue-report/generateReport.js:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+const { Octokit } = require("@octokit/rest");
+const nodemailer = require('nodemailer');
+
+function sendReport(title, header, issues) {
+    if (!issues || issues.length == 0) {
+        return;
+    }
+    let report = header + "\n\n"
+    for (const issue of issues) {
+        report += `${issue.url}: ${issue.title}\n`;
+    }
+      
+      nodemailer.createTransport({
+        service: process.env['ISSUE_REPORT_SENDER_EMAIL_SERVICE'], // e.g. "gmail"
+        auth: {
+          user: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+          pass: process.env['ISSUE_REPORT_SENDER_EMAIL_PASSWORD']
+        }
+      }).sendMail({
+        from: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+        to: process.env['ISSUE_REPORT_RECIPIENT_EMAIL_ADDRESS'],
+        subject: title,
+        text: report
+      }, function(error, info){
+        if (error) {
+          console.log(error);

Review Comment:
   Where will failure end up with this?



##########
scripts/ci/issue-report/generateReport.js:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+const { Octokit } = require("@octokit/rest");
+const nodemailer = require('nodemailer');
+
+function sendReport(title, header, issues) {
+    if (!issues || issues.length == 0) {
+        return;
+    }
+    let report = header + "\n\n"
+    for (const issue of issues) {
+        report += `${issue.url}: ${issue.title}\n`;
+    }
+      
+      nodemailer.createTransport({
+        service: process.env['ISSUE_REPORT_SENDER_EMAIL_SERVICE'], // e.g. "gmail"
+        auth: {
+          user: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+          pass: process.env['ISSUE_REPORT_SENDER_EMAIL_PASSWORD']
+        }
+      }).sendMail({
+        from: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+        to: process.env['ISSUE_REPORT_RECIPIENT_EMAIL_ADDRESS'],
+        subject: title,
+        text: report
+      }, function(error, info){
+        if (error) {
+          console.log(error);
+        } else {
+          console.log('Email sent: ' + info.response);

Review Comment:
   Presumably we don't want to get a notification when there is a success. So I'm guessing both the above and this are both only visible when someone opts in to debugging. Ideally we would get an explicit notification of failure somehow (probably not via an emailed report, if we failed to email a report :-).



##########
scripts/ci/issue-report/generateReport.js:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+const { Octokit } = require("@octokit/rest");
+const nodemailer = require('nodemailer');
+
+function sendReport(title, header, issues) {
+    if (!issues || issues.length == 0) {
+        return;
+    }
+    let report = header + "\n\n"
+    for (const issue of issues) {
+        report += `${issue.url}: ${issue.title}\n`;
+    }
+      
+      nodemailer.createTransport({
+        service: process.env['ISSUE_REPORT_SENDER_EMAIL_SERVICE'], // e.g. "gmail"
+        auth: {
+          user: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+          pass: process.env['ISSUE_REPORT_SENDER_EMAIL_PASSWORD']
+        }
+      }).sendMail({
+        from: process.env['ISSUE_REPORT_SENDER_EMAIL_ADDRESS'],
+        to: process.env['ISSUE_REPORT_RECIPIENT_EMAIL_ADDRESS'],
+        subject: title,
+        text: report
+      }, function(error, info){
+        if (error) {
+          console.log(error);
+        } else {
+          console.log('Email sent: ' + info.response);
+        }
+      });
+}
+
+async function generateReport() {
+    const octokit = new Octokit({});
+
+    let p0Issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
+    owner: 'apache',
+    repo: 'beam',
+    labels: 'P0'
+    });
+    p0Issues = p0Issues.filter(i => {
+        for (const l of i.labels) {
+            if (l.name == "flaky") {
+                return false;
+            }
+        }
+        return true;
+    });
+    let p0Header = `This is your daily summary of Beam's current P0 issues, not including flaky tests.
+
+    See https://beam.apache.org/contribute/issue-priorities/#p0-outage for the meaning and expectations around P0 issues.
+
+`;
+    sendReport(`P0 issues report (${p0Issues.length})`, p0Header, p0Issues);
+
+    let p1Issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
+    owner: 'apache',
+    repo: 'beam',
+    labels: 'P1'
+    });
+    p1Issues = p1Issues.filter(i => {
+        for (const l of i.labels) {
+            if (l.name == "flaky") {
+                return false;
+            }
+        }
+        return true;
+    });
+    let p1Header = `This is your daily summary of Beam's current P1 issues, not including flaky tests.
+
+    See https://beam.apache.org/contribute/issue-priorities/#p1-critical for the meaning and expectations around P1 issues.
+
+`;
+    sendReport(`P1 issues report (${p1Issues.length})`, p1Header, p1Issues);
+
+    let flakyIssues = await octokit.paginate(octokit.rest.issues.listForRepo, {
+    owner: 'apache',
+    repo: 'beam',
+    labels: 'flaky'

Review Comment:
   Incidentally, I standardized on the label `flake` because people are inconsistent about `flaky` and `flakey`. Let's see if that becomes an issue or not? Or are labels more locked down now so it won't be a problem? Or we could have a bot that adjusts common spelling errors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org