From b74c7455ec215b0ceccbc01d8a792e4d00cb9aab Mon Sep 17 00:00:00 2001 From: Dianjin Wang Date: Wed, 13 May 2026 16:26:41 +0800 Subject: [PATCH 1/5] ASF: update files for compliance --- CODE_OF_CONDUCT.md | 158 +++++++------------------------------ CONTRIBUTING.md | 189 +++++++++++++++++++++++++++------------------ DISCLAIMER | 9 +++ NOTICE | 41 +--------- README.md | 21 ++++- SECURITY.md | 99 ++++++++++++------------ 6 files changed, 221 insertions(+), 296 deletions(-) create mode 100644 DISCLAIMER diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 922d7f5..8c56ac8 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,131 +1,27 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, - without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at info@cloudberrydb.org. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations + + +# Code of Conduct + +Apache Cloudberry (Incubating) follows the ASF [Code of +Conduct](https://www.apache.org/foundation/policies/conduct). + +If you observe behavior that violates those rules please follow the +[ASF reporting +guidelines](https://www.apache.org/foundation/policies/conduct#reporting-guidelines). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 882aebb..ed9a24b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,79 +1,116 @@ -Cloudberry Database community welcomes contributions from anyone, new and -experienced! We appreciate your interest in contributing. This guide will help -you get started with the contribution. + + +Apache Cloudberry (Incubating) welcomes contributions from anyone, new +and experienced! We appreciate your interest in contributing. This +guide will help you get started with the contribution. ## Code of Conduct -Everyone who participates in Cloudberry Database, either as a user or a -contributor, is obliged to follow our community [Code of -Conduct](./CODE_OF_CONDUCT.md). Every violation against it will be reviewed -and investigated and will result in a response that is deemed necessary and -appropriate to the circumstances. The moderator team is obligated to maintain -confidentiality regarding the reporter of an incident. - -Some behaviors that contribute to creating a positive environment include: - -* Use welcoming and inclusive language. -* Respect differing viewpoints and experiences. -* Accept constructive criticism gracefully. -* Foster what's best for the community. -* Show empathy for community members. - -## GitHub Contribution Workflow - -1. Fork this repo to your own GitHub account. -2. Clone down the repo to your local system. - -``` -git clone https://github.com/your-user-name/cloudberry-go-libs.git -``` - -3. Add the upstream repo. (You only have to do this once, not every time.) - -``` -git remote add upstream https://github.com/apache/cloudberry-go-libs.git -``` - -4. Create a new branch to hold your work. - -``` -git checkout -b new-branch-name -``` - -5. Work on your new code. -6. Commit your changes. - -``` -git add -git commit -``` - -7. Push your changes to your GitHub repo. - -``` -git push origin new-branch-name -``` - -8. Open a PR(Pull Request). - -Go to the repo on GitHub. There will be a message about your recently pushed -branch, asking if you would like to open a pull request. Follow the prompts, -compare across repositories, and submit the PR. - -9. Get your code reviewed. -10. Congratulations! Once your PR is approved, and passes the CI/CD without -errors, then the code will be merged. Your code will be shipped in the recent -future releases. - -## Sync your branch with the upstream - -Before working on your next contribution, make sure your local repository is -up to date: - -``` -git checkout main -git fetch upstream -git rebase upstream/main -``` - -``` +Everyone who participates in Cloudberry, either as a user or a +contributor, is obliged to follow the [Code of +Conduct](./CODE_OF_CONDUCT.md). + +We strive to: + +* Be open. +* Be empathetic, welcoming, friendly, and patient. +* Be collaborative. +* Be inquisitive. +* Be careful in the words that we choose. +* Be concise. +* Step down considerately. + +## Find a Way to Contribute + +There are many ways to contribute to Cloudberry. Here are some ways +you need to get started. The most common contributions include code, +documentation, and community support. + +You can participate by: + +* [Contributing code](https://cloudberry.apache.org/contribute/code). +* [Improving + documentation](https://cloudberry.apache.org/contribute/doc). +* Helping out in the Slack channels, see [Slack + Guide](https://cloudberry.apache.org/community/slack) +* Answering questions on [GitHub + Discussions](https://github.com/apache/cloudberry-go-libs/discussions/categories/q-a). +* Investigating [GitHub + issues](https://github.com/apache/cloudberry-go-libs/issues). +* [Reporting a new + bug](https://github.com/apache/cloudberry-go-libs/issues/new/choose). +* [Sharing ideas for new + features](https://github.com/apache/cloudberry-go-libs/discussions/new?category=ideas-feature-requests). +* Helping review [Pull + Requests](https://github.com/apache/cloudberry-go-libs/pulls) or + [Proposals](https://github.com/apache/cloudberry-go-libs/discussions/categories/proposal). +* Proposing your proposal, see [Proposal + Guide](https://cloudberry.apache.org/contribute/proposal). +* [Reporting security issues](./SECURITY.md). +* Testing code, testing releases. +* Creating educational content (Blog posts, tutorials, videos, etc.) +* Spreading the word about Apache Cloudberry on social media(eg, + Twitter, LinkedIn). +* ... +* More things to make Cloudberry better. + +## Getting Help + +Feel free to reach out to us in [Slack `#dev` +channels](https://cloudberry.apache.org/community/slack) or [GitHub +Discussions](https://github.com/apache/cloudberry-go-libs/discussions) when +your contribution is blocked, especially when making your first +contribution. Don't be shy, we're happy to help. + +Cloudberry cannot grow without the support from the community. Hope to +make our mission with you! + +## Benefits of Contribution + +There are many reasons to contribute to Cloudberry and open source +projects in general. Here are some of the benefits of participating: + +* Growing your network. Working with Cloudberry in open source can +help connect you with people working on similar things. You can get +help or give help, and you might even make a real-life acquaintance! + +* Improving your skills. When you work on a Cloudberry issue or Pull +Request, inevitably you'll learn more about how something works in our +project; either by asking questions and gathering info or by digging +deeper into the code yourself. There's a skill-building benefit to +contributing to open source projects. + +* Becoming an expert. You might start new to a project like Cloudberry +or PostgreSQL, and by building things and opening issues when you +encounter a new challenge or a bug, you'll learn a ton over time. You +could find your knowledge of said project has grown so much that +you've become an expert. + +* Speaking at conferences or more community events. With those skills +you've earned yourself working in open source, you can let other +people hear from you, and build your professional reputation through +these community activities. + +* Getting free swag! By participating in GitHub and other community +channels, you can become eligible for free swag that the Cloudberry +team offers as a way to say thank you. + +There are undoubtedly more benefits than those listed here. Hope you +enjoy your contribution to the Cloudberry community! diff --git a/DISCLAIMER b/DISCLAIMER new file mode 100644 index 0000000..2390116 --- /dev/null +++ b/DISCLAIMER @@ -0,0 +1,9 @@ +Apache Cloudberry is an effort undergoing incubation at The Apache +Software Foundation (ASF), sponsored by the Apache +Incubator. Incubation is required of all newly accepted projects until +a further review indicates that the infrastructure, communications, +and decision making process have stabilized in a manner consistent +with other successful ASF projects. While incubation status is not +necessarily a reflection of the completeness or stability of the code, +it does indicate that the project has yet to be fully endorsed by the +ASF. diff --git a/NOTICE b/NOTICE index d776753..1bc302b 100644 --- a/NOTICE +++ b/NOTICE @@ -1,38 +1,5 @@ -gp-common-go-libs for CloudberryDB +Apache Cloudberry (Incubating) +Copyright 2024-2026 The Apache Software Foundation -Portions Copyright 2016-2023 HashData Technology Limited. or its affiliates. -All Rights Reserved. - - 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. - -This product may include a number of subcomponents with separate copyright -notices and license terms. Your use of these subcomponents is subject to the -terms and conditions of the subcomponent's license. - --------------------------------------- - -Greenplum Database Common Go Libraries - -Copyright 2017-Present VMware, Inc. or its affiliates. All Rights Reserved. - -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. +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/README.md b/README.md index 19aa595..4c25673 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ + + # go-libs for Apache Cloudberry (Incubating) [![Slack](https://img.shields.io/badge/Join_Slack-6a32c9)](https://communityinviter.com/apps/cloudberrydb/welcome) @@ -7,7 +26,7 @@ --- This project is a fork of the `Greenplum gp-common-go-libs`, which is a -dependency for the [gpbackup](https://github.com/cloudberrydb/gpbackup) +dependency for the [gpbackup](https://github.com/apache/cloudberry-backup) utility in Cloudberry. Please note that this repository is only maintained for Cloudberry 1.0 and diff --git a/SECURITY.md b/SECURITY.md index 36b4887..a85186f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,63 +1,60 @@ -Thanks for helping make Cloudberry Database safe! + + +# Security Policy + +The Apache Security Team handles all security issues across Apache projects and +coordinates the response to vulnerabilities. For details on the vulnerability +handling process, supported versions, and what is considered a security issue, +visit: https://www.apache.org/security/. ---- - -## Reporting Security Issues - -To report a security issue, please email -[security@cloudberrydb.org](mailto:security@cloudberrydb.org). This -project follows a 90-day disclosure timeline. We will publish the -[security -advisories](https://github.com/cloudberrydb/cloudberrydb/security/advisories) -via GitHub. - -You should receive a response within 2 weeks. If for some reason you -do not, please follow up via email to ensure we received your original -message. - -Please include the requested information listed below (as much as you -can provide) to help us better understand the nature and scope of the -possible issue: +## Do not -* Type of issue (e.g. buffer overflow, SQL injection, cross-site - scripting, etc.) -* Full paths of source file(s) related to the manifestation of the - issue -* The location of the affected source code (tag/branch/commit or - direct URL) -* Any special configuration required to reproduce the issue -* Step-by-step instructions to reproduce the issue -* Proof-of-concept or exploit code (if possible) -* Impact of the issue, including how an attacker might exploit the - issue +For better collaboration, we hope you: -This information will help us triage your report more quickly. +- DO NOT report non-security-impacting bugs through this channel. If you have + any questions on using, development, please use [GitHub + Issues](https://github.com/apache/cloudberry-go-libs/issues), + [Discussions](https://github.com/apache/cloudberry-go-libs/discussions), [Dev mailing + list](https://cloudberry.apache.org/community/mailing-lists) or + [Slack](https://inviter.co/apache-cloudberry) instead. +- DO NOT report security issues on public GitHub Issues, Jira tickets, mailing + lists, or other public forums. -## Do not +## Reporting Security Issues -For better collaboration, we hope you: +Send your report to: [security@apache.org](mailto:security@apache.org). -- Do not file public issues on GitHub for security vulnerabilities. -- Do not report non-security-impacting bugs through this channel. If - you have any questions on using, development, please use [GitHub - Issues, Discussions or - Slack](https://github.com/cloudberrydb/cloudberrydb/issues/new/choose) - instead. +Please send one plain-text email per vulnerability with the following and +additional information as necessary (as much as you can provide): -## Handling Process +- Description of the vulnerability +- Steps to reproduce +- Affected versions +- Potential impact +- Any known mitigations +- (Optional) Suggested fix -Here's an overview of the security issues handling process: +## Public Discussion -* The reporter reports the security issues to the Cloudberry Database - team. -* The Cloudberry Database team investigates the report and decides to - accept or reject the report. If our team rejects the report, the - team will explain why to the reporter. If we accept the report, our - team will work privately with the reporter to fix the security - issues. -* Release the new version of the Cloudberry Database that includes the - fix. -* Public the security issues. +For general security questions or discussions, please use the development +mailing list: [dev@cloudberry.apache.org](mailto:dev@cloudberry.apache.org) ## Preferred Languages From e1297e30f1881cfc4c7b964ba131dfb5d3643bd4 Mon Sep 17 00:00:00 2001 From: Dianjin Wang Date: Thu, 14 May 2026 15:15:34 +0800 Subject: [PATCH 2/5] Update --- .github/ISSUE_TEMPLATE/bug-report.yml | 28 ++- .github/ISSUE_TEMPLATE/config.yml | 37 +++- .github/pull_request_template.md | 13 +- .github/workflows/apache-rat-audit.yml | 275 +++++++++++++++++++++++++ CONTRIBUTING.md | 169 +++++++-------- NOTICE | 20 ++ README.apache.md | 44 ++++ README.md | 35 ++-- pom.xml | 166 +++++++++++++++ 9 files changed, 664 insertions(+), 123 deletions(-) create mode 100644 .github/workflows/apache-rat-audit.yml create mode 100644 README.apache.md create mode 100644 pom.xml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 965783d..a4f3393 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,14 +1,34 @@ +# -------------------------------------------------------------------- +# +# 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. +# +# -------------------------------------------------------------------- + name: "\U0001F41B Bug Report" -description: Problems and issues with code in gp-common-go-libs for CloudberryDB. +description: Problems and issues with code in cloudberry-go-libs for Apache Cloudberry. title: "[Bug] " labels: ["type: Bug"] body: - type: markdown attributes: - value: "Thank you for reporting the problem! We really appreciate your efforts to improve Cloudberry Database. Before reporting it, please (ideally) test on the latest release or main to see if the issue is fixed." + value: "Thank you for reporting the problem! We really appreciate your efforts to improve Apache Cloudberry. Before reporting it, please (ideally) test on the latest release or main to see if the issue is fixed." - type: textarea attributes: - label: Cloudberry Database version + label: Apache Cloudberry version description: What version are you using? - type: textarea attributes: @@ -56,7 +76,7 @@ body: options: - label: > I agree to follow this project's - [Code of Conduct](https://cloudberrydb.org/community/coc). + [Code of Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md). required: true - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index a3a57eb..b9a5157 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,14 +1,37 @@ -blank_issues_enabled: false +# -------------------------------------------------------------------- +# +# 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. +# +# -------------------------------------------------------------------- + +blank_issues_enabled: true contact_links: - name: 🙏🏻 Q&A - url: https://github.com/orgs/cloudberrydb/discussions/categories/q-a - about: Ask for help when running/developing Cloudberry Database. + url: https://github.com/apache/cloudberry/discussions/categories/q-a + about: Ask for help when running/developing Apache Cloudberry. - name: 💡️ New Ideas / Feature Requests - url: https://github.com/orgs/cloudberrydb/discussions/categories/ideas-feature-requests + url: https://github.com/apache/cloudberry/discussions/categories/ideas-feature-requests about: Share ideas for new features. - name: 🎙️ Submit Your Proposal - url: https://github.com/orgs/cloudberrydb/discussions/categories/proposal - about: As a developer, proposing any major change or enhancement to Cloudberry Database. + url: https://github.com/apache/cloudberry/discussions/categories/proposal + about: As a developer, proposing any major change or enhancement to Apache Cloudberry. - name: 💬️ Join Slack for Real-time Chat - url: https://communityinviter.com/apps/cloudberrydb/welcome + url: https://inviter.co/apache-cloudberry about: Real-time chat including QA, Dev, Events and more. + - name: 🪲 Issues for Website, Docs + url: https://github.com/apache/cloudberry-site/issues + about: Hey, we have one dedicated repo for the website and docs. \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0dfb7e8..18c97eb 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,7 @@ + -fix #ISSUE_Number +closes: #ISSUE_Number --- @@ -13,8 +14,8 @@ fix #ISSUE_Number Here are some reminders before you submit your pull request: -* Make sure that your Pull Request has a clear title and commit message. You can take the [Git commit template](https://github.com/cloudberrydb/cloudberrydb/blob/main/.gitmessage) as a reference. -* Sign the Contributor License Agreement as prompted for your first-time contribution (*One-time setup*). -* Learn the [code contribution](https://cloudberrydb.org/contribute/code) and [doc contribution](https://cloudberrydb.org/contribute/doc) guides for better collaboration. -* List your communications in the [GitHub Issues](https://github.com/cloudberrydb/cloudberrydb-site/issues) or [Discussions](https://github.com/orgs/cloudberrydb/discussions) (if has or needed). -* Feel free to ask for the cloudberrydb team to help review and approve. +* Make sure that your Pull Request has a clear title and commit message. You can take the [Git commit template](https://github.com/apache/cloudberry/blob/main/.gitmessage) as a reference. +* Learn the [code contribution](https://cloudberry.apache.org/contribute/code) and [doc contribution](https://cloudberry.apache.org/contribute/doc) guides for better collaboration. +* Make sure that CICD workflow is successful. +* List your communications in the [GitHub Issues](https://github.com/apache/cloudberry-go-libs/issues) or [Discussions](https://github.com/apache/cloudberry/discussions) (if has or needed). +* Feel free to ask for the [cloudberry committers](https://github.com/orgs/apache/teams/cloudberry-committers) or other people to help review and approve. \ No newline at end of file diff --git a/.github/workflows/apache-rat-audit.yml b/.github/workflows/apache-rat-audit.yml new file mode 100644 index 0000000..af8aaae --- /dev/null +++ b/.github/workflows/apache-rat-audit.yml @@ -0,0 +1,275 @@ +# -------------------------------------------------------------------- +# +# 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. +# +# -------------------------------------------------------------------- +# Apache Cloudberry Go-libs (Incubating) Compliance Workflow +# +# Comprehensive compliance checks for Apache Cloudberry Go-libs: +# 1. Apache RAT license header validation +# 2. Copyright year verification (NOTICE) +# 3. Binary file presence detection +# +# Based on Apache Rat tool, run locally with: +# `mvn clean verify -Drat.consoleOutput=true` +# -------------------------------------------------------------------- + +name: Apache Rat License Check + +on: + push: + branches: [main, REL_2_STABLE] + pull_request: + branches: [main, REL_2_STABLE] + types: [opened, synchronize, reopened, edited] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + rat-check: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Set up Java and Maven + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + cache: maven + + - name: Run Apache Rat check + run: | + echo "Running Apache Rat license check..." + mvn clean verify -Drat.consoleOutput=true | tee rat-output.log + + # Check for build failure + if grep -q "\[INFO\] BUILD FAILURE" rat-output.log; then + echo "::error::Apache Rat check failed - build failure detected" + echo "RAT_CHECK=fail" >> $GITHUB_ENV + else + echo "RAT_CHECK=pass" >> $GITHUB_ENV + echo "Apache Rat check passed successfully" + fi + + - name: Check copyright years are up-to-date + run: | + echo "Checking copyright years..." + current_year=$(date -u +"%Y") + echo "CURRENT_YEAR=$current_year" >> $GITHUB_ENV + + # Initialize to pass, will be updated if checks fail + echo "NOTICE_CHECK=pass" >> $GITHUB_ENV + echo "PSQL_HELP_CHECK=pass" >> $GITHUB_ENV + + # Check NOTICE file + echo "Checking NOTICE file..." + if ! grep -q "Copyright 2024-$current_year The Apache Software Foundation" NOTICE; then + echo "::error::NOTICE file does not contain the current year ($current_year)" + echo "NOTICE_CHECK=fail" >> $GITHUB_ENV + else + echo "PASS: NOTICE file contains the current year ($current_year)" + fi + + # Continue execution even if checks fail + if [ "$NOTICE_CHECK" = "pass" ]; then + echo "All copyright year checks passed" + else + echo "Copyright year checks completed with errors" + fi + + - name: Check for binary files + run: | + echo "Checking for binary files..." + echo "Checking extensions: class, jar, tar, tgz, zip, exe, dll, so, gz, bz2" + echo "----------------------------------------------------------------------" + + # Check for specific binary file extensions + binary_extensions="class jar tar tgz zip exe dll so gz bz2" + echo "BINARY_EXTENSIONS=${binary_extensions}" >> $GITHUB_ENV + binary_results="" + binaryfiles_found=false + + for extension in ${binary_extensions}; do + printf "Checking *.%-4s files..." "${extension}" + found=$(find . -name "*.${extension}" -type f || true) + + if [ -n "$found" ]; then + echo "FOUND" + echo "::error::${extension} files should not exist" + echo "For ASF compatibility: the source tree should not contain" + echo "binary files as users have a hard time verifying their contents." + echo "Found files:" + echo "$found" | sed 's/^/ /' + echo "${extension}:${found}" >> binary_results.txt + binaryfiles_found=true + else + echo "NONE" + echo "${extension}:none" >> binary_results.txt + fi + done + + echo "----------------------------------------------------------------------" + if [ "$binaryfiles_found" = true ]; then + echo "ERROR: Binary files were found in the source tree" + echo "BINARY_CHECK=fail" >> $GITHUB_ENV + else + echo "PASS: No binary files found" + echo "BINARY_CHECK=pass" >> $GITHUB_ENV + fi + + - name: Upload Rat check results + if: always() + uses: actions/upload-artifact@v4 + with: + name: rat-check-results + path: rat-output.log + retention-days: 7 + + - name: Generate Job Summary + if: always() + run: | + { + echo "## Apache Cloudberry Go-libs Compliance Audit Results" + echo "- Run Time: $(date -u +'%Y-%m-%d %H:%M:%S UTC')" + echo "" + + # Copyright Year Check Summary + echo "### Copyright Year Checks" + echo "**NOTICE file:**" + if [ "$NOTICE_CHECK" = "pass" ]; then + echo "PASS: Contains current year ($CURRENT_YEAR)" + else + echo "ERROR: Does not contain current year ($CURRENT_YEAR)" + fi + echo "" + + # Binary Files Check Summary + echo "### Binary Files Check" + echo "Checked extensions: \`${BINARY_EXTENSIONS}\`" + echo "" + echo "Results:" + echo "\`\`\`" + if [ -f binary_results.txt ]; then + while IFS=: read -r ext files; do + if [ "$files" = "none" ]; then + echo "PASS: No .${ext} files found" + else + echo "ERROR: Found .${ext} files:" + echo "$files" | sed 's/^/ /' + fi + done < binary_results.txt + fi + echo "\`\`\`" + echo "" + + # Rat check summary + if [[ -f rat-output.log ]]; then + # First extract and display summary statistics (only once) + if grep -q "Rat check: Summary over all files" rat-output.log; then + echo "### License Header Check" + summary_line=$(grep "Rat check: Summary over all files" rat-output.log) + echo "\`\`\`" + echo "$summary_line" + echo "\`\`\`" + echo "" + fi + + # Then determine the result status + if [ "$RAT_CHECK" = "fail" ]; then + echo "#### Check Failed - License Compliance Issues Detected" + echo "" + + # Extract and display files with unapproved licenses + if grep -q "Files with unapproved licenses:" rat-output.log; then + echo "##### Files with Unapproved Licenses" + echo "\`\`\`" + # Get the line with "Files with unapproved licenses:" and all following lines until the dashed line + sed -n '/Files with unapproved licenses:/,/\[INFO\] ------------------------------------------------------------------------/p' rat-output.log | \ + grep -v "\[INFO\] ------------------------------------------------------------------------" | \ + grep -v "^$" | \ + head -20 + echo "\`\`\`" + echo "" + fi + + echo "**How to fix:**" + echo "" + echo "**For new original files you created:**" + echo "- Add the standard Apache License header to each file" + echo "" + echo "**For third-party files with different licenses:**" + echo "- Add the file to exclusion list in \`pom.xml\` under the rat-maven-plugin configuration" + echo "- Ensure the license is compatible with Apache License 2.0" + echo "- Avoid introducing components with incompatible licenses" + echo "" + echo "**Need help?**" + echo "- Run \`mvn clean verify -Drat.consoleOutput=true\` locally for the full report" + echo "- Email dev@cloudberry.apache.org if you have questions about license compatibility" + + elif [ "$RAT_CHECK" = "pass" ]; then + echo "#### Check Passed - All Files Comply with Apache License Requirements" + fi + fi + } >> "$GITHUB_STEP_SUMMARY" + + - name: Report Status + if: always() + shell: bash {0} + run: | + # Check overall status of all checks + overall_status=0 + + # Check Apache RAT status + if [ "$RAT_CHECK" = "fail" ]; then + echo "ERROR: Apache Rat check failed" + overall_status=1 + elif [ "$RAT_CHECK" = "pass" ]; then + echo "Apache Rat check passed" + fi + + # Check copyright year status + if [ -n "$NOTICE_CHECK" ] && [ "$NOTICE_CHECK" = "fail" ]; then + echo "ERROR: NOTICE file copyright year check failed" + overall_status=1 + fi + + # Check binary files status (if this variable exists) + if [ -n "$BINARY_CHECK" ] && [ "$BINARY_CHECK" = "fail" ]; then + echo "ERROR: Binary files check failed" + overall_status=1 + fi + + # Exit with appropriate status + if [ $overall_status -eq 0 ]; then + echo "SUCCESS: All checks passed" + exit 0 + else + echo "FAILURE: One or more checks failed" + exit 1 + fi \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed9a24b..0672875 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,100 +17,81 @@ under the License. --> -Apache Cloudberry (Incubating) welcomes contributions from anyone, new -and experienced! We appreciate your interest in contributing. This -guide will help you get started with the contribution. +Apache Cloudberry community welcomes contributions from anyone, new and +experienced! We appreciate your interest in contributing. This guide will help +you get started with the contribution. ## Code of Conduct -Everyone who participates in Cloudberry, either as a user or a -contributor, is obliged to follow the [Code of -Conduct](./CODE_OF_CONDUCT.md). - -We strive to: - -* Be open. -* Be empathetic, welcoming, friendly, and patient. -* Be collaborative. -* Be inquisitive. -* Be careful in the words that we choose. -* Be concise. -* Step down considerately. - -## Find a Way to Contribute - -There are many ways to contribute to Cloudberry. Here are some ways -you need to get started. The most common contributions include code, -documentation, and community support. - -You can participate by: - -* [Contributing code](https://cloudberry.apache.org/contribute/code). -* [Improving - documentation](https://cloudberry.apache.org/contribute/doc). -* Helping out in the Slack channels, see [Slack - Guide](https://cloudberry.apache.org/community/slack) -* Answering questions on [GitHub - Discussions](https://github.com/apache/cloudberry-go-libs/discussions/categories/q-a). -* Investigating [GitHub - issues](https://github.com/apache/cloudberry-go-libs/issues). -* [Reporting a new - bug](https://github.com/apache/cloudberry-go-libs/issues/new/choose). -* [Sharing ideas for new - features](https://github.com/apache/cloudberry-go-libs/discussions/new?category=ideas-feature-requests). -* Helping review [Pull - Requests](https://github.com/apache/cloudberry-go-libs/pulls) or - [Proposals](https://github.com/apache/cloudberry-go-libs/discussions/categories/proposal). -* Proposing your proposal, see [Proposal - Guide](https://cloudberry.apache.org/contribute/proposal). -* [Reporting security issues](./SECURITY.md). -* Testing code, testing releases. -* Creating educational content (Blog posts, tutorials, videos, etc.) -* Spreading the word about Apache Cloudberry on social media(eg, - Twitter, LinkedIn). -* ... -* More things to make Cloudberry better. - -## Getting Help - -Feel free to reach out to us in [Slack `#dev` -channels](https://cloudberry.apache.org/community/slack) or [GitHub -Discussions](https://github.com/apache/cloudberry-go-libs/discussions) when -your contribution is blocked, especially when making your first -contribution. Don't be shy, we're happy to help. - -Cloudberry cannot grow without the support from the community. Hope to -make our mission with you! - -## Benefits of Contribution - -There are many reasons to contribute to Cloudberry and open source -projects in general. Here are some of the benefits of participating: - -* Growing your network. Working with Cloudberry in open source can -help connect you with people working on similar things. You can get -help or give help, and you might even make a real-life acquaintance! - -* Improving your skills. When you work on a Cloudberry issue or Pull -Request, inevitably you'll learn more about how something works in our -project; either by asking questions and gathering info or by digging -deeper into the code yourself. There's a skill-building benefit to -contributing to open source projects. - -* Becoming an expert. You might start new to a project like Cloudberry -or PostgreSQL, and by building things and opening issues when you -encounter a new challenge or a bug, you'll learn a ton over time. You -could find your knowledge of said project has grown so much that -you've become an expert. - -* Speaking at conferences or more community events. With those skills -you've earned yourself working in open source, you can let other -people hear from you, and build your professional reputation through -these community activities. - -* Getting free swag! By participating in GitHub and other community -channels, you can become eligible for free swag that the Cloudberry -team offers as a way to say thank you. - -There are undoubtedly more benefits than those listed here. Hope you -enjoy your contribution to the Cloudberry community! +Everyone who participates in Apache Cloudberry, either as a user or a +contributor, is obliged to follow our community [Code of +Conduct](./CODE_OF_CONDUCT.md). Every violation against it will be reviewed +and investigated and will result in a response that is deemed necessary and +appropriate to the circumstances. The moderator team is obligated to maintain +confidentiality regarding the reporter of an incident. + +Some behaviors that contribute to creating a positive environment include: + +* Use welcoming and inclusive language. +* Respect differing viewpoints and experiences. +* Accept constructive criticism gracefully. +* Foster what's best for the community. +* Show empathy for community members. + +## GitHub Contribution Workflow + +1. Fork this repo to your own GitHub account. +2. Clone down the repo to your local system. + +``` +git clone https://github.com/your-user-name/cloudberry-go-libs.git +``` + +3. Add the upstream repo. (You only have to do this once, not every time.) + +``` +git remote add upstream https://github.com/apache/cloudberry-go-libs.git +``` + +4. Create a new branch to hold your work. + +``` +git checkout -b new-branch-name +``` + +5. Work on your new code. + +6. Commit your changes. + +``` +git add +git commit +``` + +7. Push your changes to your GitHub repo. + +``` +git push origin new-branch-name +``` + +8. Open a PR(Pull Request). + +Go to the repo on GitHub. There will be a message about your recently pushed +branch, asking if you would like to open a pull request. Follow the prompts, +compare across repositories, and submit the PR. + +9. Get your code reviewed. +10. Congratulations! Once your PR is approved, and passes the CI/CD without +errors, then the code will be merged. Your code will be shipped in the recent +future releases. + +## Sync your branch with the upstream + +Before working on your next contribution, make sure your local repository is +up to date: + +``` +git checkout main +git fetch upstream +git rebase upstream/main +``` diff --git a/NOTICE b/NOTICE index 1bc302b..873f1a7 100644 --- a/NOTICE +++ b/NOTICE @@ -3,3 +3,23 @@ Copyright 2024-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). + +--------------------------------------------------------------------------- + +This product includes software originally developed by VMware. + +Greenplum Database Common Go Libraries + +Copyright 2017-Present VMware, Inc. or its affiliates. All Rights Reserved. + +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. diff --git a/README.apache.md b/README.apache.md new file mode 100644 index 0000000..020dd78 --- /dev/null +++ b/README.apache.md @@ -0,0 +1,44 @@ + + +# Apache Cloudberry Go-libs (Incubating) License Audit Notes + +This file documents licensing clarifications and exceptions as part of ASF +release readiness for Apache Cloudberry Go-libs (Incubating). + +## Historical Attribution Under Apache License 2.0 + +The following entities have contributed to the Greenplum Database Common Go +Libraries source code under the Apache License 2.0: + +- Greenplum, Inc. +- EMC Corporation +- VMware, Inc. +- Pivotal Software + +RAT matchers are used to classify their license headers accordingly. + +## Binary Files in Source + +This project does not include any binary files in the source tree. All files +are source code files with Apache License 2.0 headers. + +## Compressed Files in Source + +This project does not include any compressed/archived files in the source tree. diff --git a/README.md b/README.md index 4c25673..c2c0d94 100644 --- a/README.md +++ b/README.md @@ -17,27 +17,38 @@ under the License. --> -# go-libs for Apache Cloudberry (Incubating) +# Go Libraries for Apache Cloudberry (Incubating) -[![Slack](https://img.shields.io/badge/Join_Slack-6a32c9)](https://communityinviter.com/apps/cloudberrydb/welcome) -[![Twitter Follow](https://img.shields.io/twitter/follow/cloudberrydb)](https://twitter.com/cloudberrydb) -[![Website](https://img.shields.io/badge/Visit%20Website-eebc46)](https://cloudberry.apache.org) +[![Website](https://img.shields.io/badge/Website-eebc46)](https://cloudberry.apache.org) +[![Documentation](https://img.shields.io/badge/Documentation-acd94a)](https://cloudberry.apache.org/docs) +[![Slack](https://img.shields.io/badge/Join_Slack-6a32c9)](https://inviter.co/apache-cloudberry) +[![Twitter Follow](https://img.shields.io/twitter/follow/ASFCloudberry)](https://twitter.com/ASFCloudberry) +[![WeChat](https://img.shields.io/badge/WeChat-eebc46)](https://cloudberry.apache.org/community/wechat) +[![Youtube](https://img.shields.io/badge/Youtube-gebc46)](https://youtube.com/@ApacheCloudberry) +[![GitHub Discussions](https://img.shields.io/github/discussions/apache/cloudberry)](https://github.com/apache/cloudberry/discussions) --- -This project is a fork of the `Greenplum gp-common-go-libs`, which is a -dependency for the [gpbackup](https://github.com/apache/cloudberry-backup) -utility in Cloudberry. +## Introduction -Please note that this repository is only maintained for Cloudberry 1.0 and -its later versions. +This repository contains the Go libraries used by Apache Cloudberry (Incubating) +and its ecosystem projects. It provides common utilities and functionality that +are shared across multiple Cloudberry components. + +## Contribution + +See [CONTRIBUTING.md](./CONTRIBUTING.md) for how to make contributions to this +repository. We welcome all types of contributions including code enhancements, +bug fixes, documentation improvements, and more. ## License -Licensed under Apache License Version 2.0. For more details, please refer to -the [LICENSE](./LICENSE). +Cloudberry is licensed under the Apache License, Version 2.0. For details, see +the [LICENSE](./LICENSE) file. ## Acknowledgment -Thanks to all the gp-common-go-libs contributors, more details in its [GitHub +This project is derived from [greenplum/gp-common-go-libs](https://github.com/greenplum-db/gp-common-go-libs) and customized for Apache Cloudberry. + +Thanks to all the `gp-common-go-libs` contributors, more details in its [GitHub page](https://github.com/greenplum-db/gp-common-go-libs). diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..c9cbd64 --- /dev/null +++ b/pom.xml @@ -0,0 +1,166 @@ + + + + + 4.0.0 + org.apache.cloudberry + apache-cloudberry-go-libs-incubating + 2.1.0-incubating + pom + + Apache Cloudberry Go-libs (Incubating) + Go Libraries for Apache Cloudberry (Incubating) + + + + + org.apache.rat + apache-rat-plugin + 0.16.1 + + true + + + + + cluster/cluster.go + cluster/cluster_test.go + + + conv/const.go + conv/conv_suite_test.go + conv/float.go + conv/float_test.go + conv/int.go + conv/int_test.go + conv/md5.go + conv/md5_test.go + conv/README.md + conv/uint.go + conv/uint_test.go + + + dbconn/dbconn.go + dbconn/dbconn_test.go + dbconn/version.go + dbconn/version_test.go + + + gperror/gperror.go + gperror/gperror_test.go + + + gplog/gplog.go + gplog/gplog_test.go + + + iohelper/iohelper.go + iohelper/iohelper_test.go + + + operating/operating.go + + + structmatcher/structmatcher.go + structmatcher/structmatcher_test.go + + + testhelper/functions.go + testhelper/structs.go + + + Makefile + go.mod + go.sum + show_coverage.sh + + + + + .github/pull_request_template.md + + + + + + + Apache License (Greenplum-derived) + GRPM + + copyright (c) 2007, 2008, 2009 GreenPlum. All rights reserved. + + + + + Apache License (VMware-derived) + VMW + + Copyright 2017-Present VMware, Inc. or its affiliates. + Portions Copyright (c) 2023 VMware, Inc. or its affiliates. + + + + + + + + Apache License (Greenplum-derived) + + + Apache License (VMware-derived) + + + + + + + verify + + check + + + + + + + From 2cded07a67763ebe057346238a3a5d6a10374ce6 Mon Sep 17 00:00:00 2001 From: Dianjin Wang Date: Sat, 16 May 2026 08:08:41 +0800 Subject: [PATCH 3/5] Update license check --- .github/workflows/apache-rat-audit.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/apache-rat-audit.yml b/.github/workflows/apache-rat-audit.yml index af8aaae..f455754 100644 --- a/.github/workflows/apache-rat-audit.yml +++ b/.github/workflows/apache-rat-audit.yml @@ -85,7 +85,6 @@ jobs: # Initialize to pass, will be updated if checks fail echo "NOTICE_CHECK=pass" >> $GITHUB_ENV - echo "PSQL_HELP_CHECK=pass" >> $GITHUB_ENV # Check NOTICE file echo "Checking NOTICE file..." From 3af40d2ad535b65a7e64eec35845a7836d01e280 Mon Sep 17 00:00:00 2001 From: Dianjin Wang Date: Sat, 16 May 2026 19:18:07 +0800 Subject: [PATCH 4/5] update --- .github/workflows/apache-rat-audit.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/apache-rat-audit.yml b/.github/workflows/apache-rat-audit.yml index f455754..296d610 100644 --- a/.github/workflows/apache-rat-audit.yml +++ b/.github/workflows/apache-rat-audit.yml @@ -66,10 +66,10 @@ jobs: - name: Run Apache Rat check run: | echo "Running Apache Rat license check..." - mvn clean verify -Drat.consoleOutput=true | tee rat-output.log + mvn clean verify -Drat.consoleOutput=true | tee target/rat-output.log # Check for build failure - if grep -q "\[INFO\] BUILD FAILURE" rat-output.log; then + if grep -q "\[INFO\] BUILD FAILURE" target/rat-output.log; then echo "::error::Apache Rat check failed - build failure detected" echo "RAT_CHECK=fail" >> $GITHUB_ENV else @@ -147,7 +147,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: rat-check-results - path: rat-output.log + path: target/rat-output.log retention-days: 7 - name: Generate Job Summary @@ -188,11 +188,11 @@ jobs: echo "" # Rat check summary - if [[ -f rat-output.log ]]; then + if [[ -f target/rat-output.log ]]; then # First extract and display summary statistics (only once) - if grep -q "Rat check: Summary over all files" rat-output.log; then + if grep -q "Rat check: Summary over all files" target/rat-output.log; then echo "### License Header Check" - summary_line=$(grep "Rat check: Summary over all files" rat-output.log) + summary_line=$(grep "Rat check: Summary over all files" target/rat-output.log) echo "\`\`\`" echo "$summary_line" echo "\`\`\`" @@ -205,11 +205,11 @@ jobs: echo "" # Extract and display files with unapproved licenses - if grep -q "Files with unapproved licenses:" rat-output.log; then + if grep -q "Files with unapproved licenses:" target/rat-output.log; then echo "##### Files with Unapproved Licenses" echo "\`\`\`" # Get the line with "Files with unapproved licenses:" and all following lines until the dashed line - sed -n '/Files with unapproved licenses:/,/\[INFO\] ------------------------------------------------------------------------/p' rat-output.log | \ + sed -n '/Files with unapproved licenses:/,/\[INFO\] ------------------------------------------------------------------------/p' target/rat-output.log | \ grep -v "\[INFO\] ------------------------------------------------------------------------" | \ grep -v "^$" | \ head -20 From 365a27e27bb12506c46c5b8dfab44d55a705be83 Mon Sep 17 00:00:00 2001 From: Dianjin Wang Date: Sat, 16 May 2026 19:22:54 +0800 Subject: [PATCH 5/5] update --- .github/workflows/apache-rat-audit.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/apache-rat-audit.yml b/.github/workflows/apache-rat-audit.yml index 296d610..ef6b44e 100644 --- a/.github/workflows/apache-rat-audit.yml +++ b/.github/workflows/apache-rat-audit.yml @@ -66,10 +66,10 @@ jobs: - name: Run Apache Rat check run: | echo "Running Apache Rat license check..." - mvn clean verify -Drat.consoleOutput=true | tee target/rat-output.log + mvn clean verify -Drat.consoleOutput=true # Check for build failure - if grep -q "\[INFO\] BUILD FAILURE" target/rat-output.log; then + if grep -q "\[INFO\] BUILD FAILURE" target/rat.txt; then echo "::error::Apache Rat check failed - build failure detected" echo "RAT_CHECK=fail" >> $GITHUB_ENV else @@ -147,7 +147,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: rat-check-results - path: target/rat-output.log + path: target/rat.txt retention-days: 7 - name: Generate Job Summary @@ -188,11 +188,11 @@ jobs: echo "" # Rat check summary - if [[ -f target/rat-output.log ]]; then + if [[ -f target/rat.txt ]]; then # First extract and display summary statistics (only once) - if grep -q "Rat check: Summary over all files" target/rat-output.log; then + if grep -q "Rat check: Summary over all files" target/rat.txt; then echo "### License Header Check" - summary_line=$(grep "Rat check: Summary over all files" target/rat-output.log) + summary_line=$(grep "Rat check: Summary over all files" target/rat.txt) echo "\`\`\`" echo "$summary_line" echo "\`\`\`" @@ -205,11 +205,11 @@ jobs: echo "" # Extract and display files with unapproved licenses - if grep -q "Files with unapproved licenses:" target/rat-output.log; then + if grep -q "Files with unapproved licenses:" target/rat.txt; then echo "##### Files with Unapproved Licenses" echo "\`\`\`" # Get the line with "Files with unapproved licenses:" and all following lines until the dashed line - sed -n '/Files with unapproved licenses:/,/\[INFO\] ------------------------------------------------------------------------/p' target/rat-output.log | \ + sed -n '/Files with unapproved licenses:/,/\[INFO\] ------------------------------------------------------------------------/p' target/rat.txt | \ grep -v "\[INFO\] ------------------------------------------------------------------------" | \ grep -v "^$" | \ head -20