Upload 25 files
Browse files- .github/ISSUE_TEMPLATE/bug_report.md +28 -0
- .github/ISSUE_TEMPLATE/enhancement.md +20 -0
- .github/ISSUE_TEMPLATE/feature_request.md +20 -0
- .github/ISSUE_TEMPLATE/oss-gg-hack-submission.yml +33 -0
- .github/PULL_REQUEST_TEMPLATE/obb_developer_pull_request_template.md +40 -0
- .github/PULL_REQUEST_TEMPLATE/platform_pull_request_template.md +40 -0
- .github/PULL_REQUEST_TEMPLATE/terminal_pull_request_template.md +29 -0
- .github/labeler.yml +27 -0
- .github/platform-drafter.yml +48 -0
- .github/pull_request_template.md +7 -0
- .github/release-drafter.yml +48 -0
- .github/scripts/noxfile.py +47 -0
- .github/scripts/process_changelog.py +82 -0
- .github/scripts/summarize_changelog.py +166 -0
- .github/workflows/README.md +100 -0
- .github/workflows/deploy-pypi-nightly.yml +41 -0
- .github/workflows/deploy-test-pypi.yml +68 -0
- .github/workflows/draft-release.yml +51 -0
- .github/workflows/general-linting.yml +96 -0
- .github/workflows/gh-branch-name-check.yml +71 -0
- .github/workflows/gh-pr-labels.yml +25 -0
- .github/workflows/macos-build.yml +218 -0
- .github/workflows/test-integration-platform.yml +115 -0
- .github/workflows/test-unit-cli.yml +46 -0
- .github/workflows/test-unit-platform.yml +46 -0
.github/ISSUE_TEMPLATE/bug_report.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: Bug report
|
| 3 |
+
about: Create a report to help us improve
|
| 4 |
+
title: "[Bug]"
|
| 5 |
+
labels: 'type:bug'
|
| 6 |
+
assignees: ''
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
**Describe the bug**
|
| 10 |
+
A clear and concise description of what the bug is.
|
| 11 |
+
|
| 12 |
+
**To Reproduce**
|
| 13 |
+
Steps(from the start) and commands to reproduce the behavior
|
| 14 |
+
|
| 15 |
+
**Screenshots**
|
| 16 |
+
If applicable, add screenshots to help explain your problem.
|
| 17 |
+
If you are running the terminal using the conda version please
|
| 18 |
+
rerun the terminal with `python terminal.py --debug`, and then
|
| 19 |
+
recreate your issue. Then include a screenshot of the entire
|
| 20 |
+
error printout.
|
| 21 |
+
|
| 22 |
+
**Desktop (please complete the following information):**
|
| 23 |
+
|
| 24 |
+
- OS: [e.g. Mac Sierra]
|
| 25 |
+
- Python version [e.g. 3.6.8]
|
| 26 |
+
|
| 27 |
+
**Additional context**
|
| 28 |
+
Add any other information that you think could be useful for us.
|
.github/ISSUE_TEMPLATE/enhancement.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: Improvement
|
| 3 |
+
about: Improve something on this project
|
| 4 |
+
title: "[IMPROVE]"
|
| 5 |
+
labels: 'type:enhancement'
|
| 6 |
+
assignees: ''
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
**What's the feature that should be improved?**
|
| 11 |
+
A description of what's the feature you want improved, and a bit of context (why is that).
|
| 12 |
+
|
| 13 |
+
**Describe how you would like the feature improved**
|
| 14 |
+
A description of what the current feature is vs what it would be after your suggestion.
|
| 15 |
+
|
| 16 |
+
**Possibly describe the ideal way to improve this**
|
| 17 |
+
If you have thought about how you would do it, add it here.
|
| 18 |
+
|
| 19 |
+
**Additional information**
|
| 20 |
+
Add any other information or screenshots about the feature improvement.
|
.github/ISSUE_TEMPLATE/feature_request.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: Feature request
|
| 3 |
+
about: Suggest an idea for this project
|
| 4 |
+
title: "[FR]"
|
| 5 |
+
labels: 'type:feature'
|
| 6 |
+
assignees: ''
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
**What's the problem of not having this feature?**
|
| 11 |
+
A clear description of what you are lacking, or why you need this additional feature.
|
| 12 |
+
|
| 13 |
+
**Describe the solution you would like**
|
| 14 |
+
A description of what you think would be the best solution for this. From user inputs, to an output.
|
| 15 |
+
|
| 16 |
+
**Describe alternatives you've considered**
|
| 17 |
+
If there are other alternatives (worth considering) to your solution, list them here.
|
| 18 |
+
|
| 19 |
+
**Additional information**
|
| 20 |
+
Add any other information or screenshots about the feature request here.
|
.github/ISSUE_TEMPLATE/oss-gg-hack-submission.yml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: oss.gg hack submission 🕹️
|
| 2 |
+
description: "Submit your contribution for the for the oss.gg hackathon"
|
| 3 |
+
title: "[🕹️]"
|
| 4 |
+
labels: 🕹️ oss.gg, player submission, hacktoberfest
|
| 5 |
+
assignees: []
|
| 6 |
+
body:
|
| 7 |
+
- type: textarea
|
| 8 |
+
id: contribution-name
|
| 9 |
+
attributes:
|
| 10 |
+
label: What side quest or challenge are you solving?
|
| 11 |
+
description: Add the name of the side quest or challenge.
|
| 12 |
+
validations:
|
| 13 |
+
required: true
|
| 14 |
+
- type: textarea
|
| 15 |
+
id: points
|
| 16 |
+
attributes:
|
| 17 |
+
label: Points
|
| 18 |
+
description: How many points are assigned to this contribution?
|
| 19 |
+
validations:
|
| 20 |
+
required: true
|
| 21 |
+
- type: textarea
|
| 22 |
+
id: description
|
| 23 |
+
attributes:
|
| 24 |
+
label: Description
|
| 25 |
+
description: What's the task your performed?
|
| 26 |
+
validations:
|
| 27 |
+
- type: textarea
|
| 28 |
+
id: proof
|
| 29 |
+
attributes:
|
| 30 |
+
label: Provide proof that you've completed the task
|
| 31 |
+
description: Screenshots, loom recordings, links to the content you shared or interacted with.
|
| 32 |
+
validations:
|
| 33 |
+
required: true
|
.github/PULL_REQUEST_TEMPLATE/obb_developer_pull_request_template.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pull Request Template for OpenBB Developers
|
| 2 |
+
|
| 3 |
+
0. **Title**:
|
| 4 |
+
|
| 5 |
+
- Format: [Type] - Brief Description (e.g., [Hotfix] - Improve Calculation Accuracy).
|
| 6 |
+
|
| 7 |
+
1. **Why**? (1-3 sentences or a bullet point list):
|
| 8 |
+
|
| 9 |
+
- State the primary reason for this change.
|
| 10 |
+
|
| 11 |
+
- Example: "To enhance the accuracy of our risk calculation in response to recent market volatility."
|
| 12 |
+
|
| 13 |
+
2. **What**? (1-3 sentences or a bullet point list):
|
| 14 |
+
|
| 15 |
+
- Describe what has been done in simple terms.
|
| 16 |
+
|
| 17 |
+
- Example: "Updated the risk calculation algorithm to factor in real-time market fluctuations."
|
| 18 |
+
|
| 19 |
+
3. **Impact** (1-2 sentences or a bullet point list):
|
| 20 |
+
|
| 21 |
+
- Briefly note the expected outcome or any potential risks and share the Impact Analysis score.
|
| 22 |
+
|
| 23 |
+
- Example: "Expected to improve risk assessment accuracy by 15%, with minimal performance impact. Impact score: 10"
|
| 24 |
+
|
| 25 |
+
> [!TIP]
|
| 26 |
+
> Refer to the Impact Analysis confluence (internal) document for more information.
|
| 27 |
+
|
| 28 |
+
4. **Testing Done**:
|
| 29 |
+
|
| 30 |
+
- A quick note on how it was tested.
|
| 31 |
+
|
| 32 |
+
- Example: "Validated with historical market data and simulated scenarios."
|
| 33 |
+
|
| 34 |
+
5. **Reviewer Notes** (optional):
|
| 35 |
+
|
| 36 |
+
- Any specific focus areas for review?
|
| 37 |
+
|
| 38 |
+
- Example: "Please check algorithm compatibility with existing data models."
|
| 39 |
+
|
| 40 |
+
6. **Any other information** (optional)
|
.github/PULL_REQUEST_TEMPLATE/platform_pull_request_template.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pull Request the OpenBB Platform
|
| 2 |
+
|
| 3 |
+
## Description
|
| 4 |
+
|
| 5 |
+
- [ ] Summary of the change/ bug fix.
|
| 6 |
+
- [ ] Link # issue, if applicable.
|
| 7 |
+
- [ ] Screenshot of the feature or the bug before/after fix, if applicable.
|
| 8 |
+
- [ ] Relevant motivation and context.
|
| 9 |
+
- [ ] List any dependencies that are required for this change.
|
| 10 |
+
|
| 11 |
+
## How has this been tested?
|
| 12 |
+
|
| 13 |
+
- Please describe the tests that you ran to verify your changes.
|
| 14 |
+
- Please provide instructions so we can reproduce.
|
| 15 |
+
- Please also list any relevant details for your test configuration.
|
| 16 |
+
|
| 17 |
+
- [ ] Ensure all unit and integration tests pass.
|
| 18 |
+
- If you modified/added command(s):
|
| 19 |
+
- [ ] Ensure the command(s) execute with the expected output.
|
| 20 |
+
- [ ] API.
|
| 21 |
+
- [ ] Python Interface.
|
| 22 |
+
- [ ] If applicable, please add new tests for the command (see [CONTRIBUTING.md](/openbb_platform/CONTRIBUTING.md) to leverage semi-automated testing).
|
| 23 |
+
- If a new provider was introduced or a new fetcher was added to an existing provider:
|
| 24 |
+
- [ ] Ensure the existing tests pass.
|
| 25 |
+
- [ ] Ensure the new provider and/or fetcher is stable and usable.
|
| 26 |
+
- [ ] If applicable, please add new tests for the provider and/or fetcher (see [CONTRIBUTING.md](/openbb_platform/CONTRIBUTING.md) to leverage semi-automated testing).
|
| 27 |
+
- If a new provider or extension was added:
|
| 28 |
+
- [ ] Update the list of [Extensions](/openbb_platform/EXTENSIONS.md).
|
| 29 |
+
- [ ] Update the list of [Providers](/openbb_platform/PROVIDERS.md).
|
| 30 |
+
- [ ] If it's a community extension or provider, update the [integration tests GitHub Action workflow](/.github/workflows/platform-api-integration-test.yml).
|
| 31 |
+
|
| 32 |
+
## Checklist
|
| 33 |
+
|
| 34 |
+
- [ ] I have performed a self-review of my own code.
|
| 35 |
+
- [ ] I have commented my code, particularly in hard-to-understand areas.
|
| 36 |
+
- [ ] I have adhered to the GitFlow naming convention and my branch name is in the format of `feature/feature-name` or `hotfix/hotfix-name`.
|
| 37 |
+
- [ ] I ensure that I am following the [CONTRIBUTING guidelines](https://github.com/OpenBB-finance/OpenBB/blob/main/CONTRIBUTING.md).
|
| 38 |
+
- [ ] (If applicable) I have updated tests following [these guidelines](/openbb_platform/CONTRIBUTING.md#qa-your-extension).
|
| 39 |
+
|
| 40 |
+
</details>
|
.github/PULL_REQUEST_TEMPLATE/terminal_pull_request_template.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pull Request the OpenBB Platform CLI
|
| 2 |
+
|
| 3 |
+
## Description
|
| 4 |
+
|
| 5 |
+
- [ ] Summary of the change/ bug fix.
|
| 6 |
+
- [ ] Link # issue, if applicable.
|
| 7 |
+
- [ ] Screenshot of the feature or the bug before/after fix, if applicable.
|
| 8 |
+
- [ ] Relevant motivation and context.
|
| 9 |
+
- [ ] List any dependencies that are required for this change.
|
| 10 |
+
|
| 11 |
+
## How has this been tested?
|
| 12 |
+
|
| 13 |
+
- Please describe the tests that you ran to verify your changes.
|
| 14 |
+
- Please provide instructions so we can reproduce.
|
| 15 |
+
- Please also list any relevant details for your test configuration.
|
| 16 |
+
|
| 17 |
+
- [ ] Ensure the affected commands still execute in the OpenBB Platform CLI.
|
| 18 |
+
- [ ] Ensure the Platform is working as intended.
|
| 19 |
+
- [ ] Check any related reports.
|
| 20 |
+
|
| 21 |
+
## Checklist
|
| 22 |
+
|
| 23 |
+
- [ ] I ensure I have self-reviewed my code.
|
| 24 |
+
- [ ] I have commented/documented my code, particularly in hard-to-understand sections.
|
| 25 |
+
- [ ] I have adhered to the GitFlow naming convention and my branch name is in the format of `feature/feature-name` or `hotfix/hotfix-name`.
|
| 26 |
+
- [ ] Update [our documentation](https://openbb-finance.github.io/OpenBBTerminal/) following [these guidelines](https://github.com/OpenBB-finance/OpenBB/tree/main/website). Update any user guides that are affected by the changes.
|
| 27 |
+
- [ ] Update our tests following [these guidelines](https://github.com/OpenBB-finance/OpenBB/tree/main/tests).
|
| 28 |
+
- [ ] Make sure you are following our [CONTRIBUTING guidelines](https://github.com/OpenBB-finance/OpenBB/blob/main/CONTRIBUTING.md).
|
| 29 |
+
- [ ] If a feature was added make sure to add it to the corresponding [integration test script](https://github.com/OpenBB-finance/OpenBB/tree/develop/openbb_terminal/miscellaneous/integration_tests_scripts).
|
.github/labeler.yml
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version: 2
|
| 2 |
+
appendOnly: true
|
| 3 |
+
labels:
|
| 4 |
+
- label: "platform"
|
| 5 |
+
files:
|
| 6 |
+
- "openbb_platform/.*"
|
| 7 |
+
|
| 8 |
+
- label: "v4"
|
| 9 |
+
files:
|
| 10 |
+
- "openbb_platform/.*"
|
| 11 |
+
|
| 12 |
+
- label: "enhancement"
|
| 13 |
+
branch: "^feature/.*"
|
| 14 |
+
|
| 15 |
+
- label: "bug"
|
| 16 |
+
branch: "^hotfix/.*"
|
| 17 |
+
|
| 18 |
+
- label: "bug"
|
| 19 |
+
branch: "^bugfix/.*"
|
| 20 |
+
|
| 21 |
+
- label: "excel"
|
| 22 |
+
files:
|
| 23 |
+
- "website/content/excel/.*"
|
| 24 |
+
|
| 25 |
+
- label: "breaking_change"
|
| 26 |
+
files:
|
| 27 |
+
- "openbb_platform/core/openbb_core/provider/standard_models/.*"
|
.github/platform-drafter.yml
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name-template: 'OpenBB Platform v$NEXT_MINOR_VERSION'
|
| 2 |
+
tag-template: 'v$NEXT_MINOR_VERSION'
|
| 3 |
+
categories:
|
| 4 |
+
- title: 🦋 OpenBB Platform Enhancements
|
| 5 |
+
labels:
|
| 6 |
+
- 'platform'
|
| 7 |
+
- 'v4'
|
| 8 |
+
- title: 🐛 OpenBB Platform Bug Fixes
|
| 9 |
+
labels:
|
| 10 |
+
- 'bug'
|
| 11 |
+
- title: 📚 OpenBB Documentation Changes
|
| 12 |
+
labels:
|
| 13 |
+
- 'docs'
|
| 14 |
+
include-labels:
|
| 15 |
+
- 'platform'
|
| 16 |
+
- 'v4'
|
| 17 |
+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
| 18 |
+
change-title-escapes: '\<*_&'
|
| 19 |
+
exclude-contributors:
|
| 20 |
+
- 'jmaslek'
|
| 21 |
+
- 'DidierRLopes'
|
| 22 |
+
- 'deeleeramone'
|
| 23 |
+
- 'hjoaquim'
|
| 24 |
+
- 'jose-donato'
|
| 25 |
+
- 'luqmanbello'
|
| 26 |
+
- 'montezdesousa'
|
| 27 |
+
- 'tehcoderer'
|
| 28 |
+
- 'colin99d'
|
| 29 |
+
- 'piiq'
|
| 30 |
+
- 'andrewkenreich'
|
| 31 |
+
- 'IgorWounds'
|
| 32 |
+
- 'minhhoang1023'
|
| 33 |
+
|
| 34 |
+
template: |
|
| 35 |
+
## Thank you and welcome to our new contributors 🔥
|
| 36 |
+
$CONTRIBUTORS
|
| 37 |
+
|
| 38 |
+
## What's new 🎉
|
| 39 |
+
|
| 40 |
+
## What's changed 🚀
|
| 41 |
+
$CHANGES
|
| 42 |
+
|
| 43 |
+
We are proud of our community contributors and staunch supporters of open-source ecosystems.
|
| 44 |
+
Help us promote our community by tagging `@openbb_finance` on X with a link to your pull request,
|
| 45 |
+
and join our Discord server to chat about your contribution! We want to hear about your experience!
|
| 46 |
+
|
| 47 |
+
### Links 🦋
|
| 48 |
+
[Website](https://openbb.co/), [Twitter](https://twitter.com/openbb_finance), [Linkedin](https://www.linkedin.com/company/openbb-finance), [Instagram](https://www.instagram.com/openbb.finance/), [Reddit](https://www.reddit.com/r/openbb/), [Discord](https://discord.com/invite/xPHTuHCmuV)
|
.github/pull_request_template.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pull Request OpenBB
|
| 2 |
+
|
| 3 |
+
Please go to the `Preview` tab and select the appropriate PR sub-template:
|
| 4 |
+
|
| 5 |
+
* [OpenBB Platform](?expand=1&template=platform_pull_request_template.md)
|
| 6 |
+
* [OpenBB Platform CLI](?expand=1&template=terminal_pull_request_template.md)
|
| 7 |
+
* [OpenBB Developers](?expand=1&template=obb_developer_pull_request_template.md)
|
.github/release-drafter.yml
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name-template: 'OpenBB Platform v$NEXT_MINOR_VERSION'
|
| 2 |
+
tag-template: 'v$NEXT_MINOR_VERSION'
|
| 3 |
+
categories:
|
| 4 |
+
- title: 🚨 OpenBB Platform Breaking Changes
|
| 5 |
+
labels:
|
| 6 |
+
- 'breaking_change'
|
| 7 |
+
- title: 🦋 OpenBB Platform Enhancements
|
| 8 |
+
labels:
|
| 9 |
+
- 'platform'
|
| 10 |
+
- 'v4'
|
| 11 |
+
- title: 🐛 OpenBB Platform Bug Fixes
|
| 12 |
+
labels:
|
| 13 |
+
- 'bug'
|
| 14 |
+
- title: 📚 OpenBB Documentation Changes
|
| 15 |
+
labels:
|
| 16 |
+
- 'docs'
|
| 17 |
+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
| 18 |
+
change-title-escapes: '\<*_&'
|
| 19 |
+
exclude-contributors:
|
| 20 |
+
- 'jmaslek'
|
| 21 |
+
- 'DidierRLopes'
|
| 22 |
+
- 'deeleeramone'
|
| 23 |
+
- 'hjoaquim'
|
| 24 |
+
- 'jose-donato'
|
| 25 |
+
- 'luqmanbello'
|
| 26 |
+
- 'montezdesousa'
|
| 27 |
+
- 'tehcoderer'
|
| 28 |
+
- 'colin99d'
|
| 29 |
+
- 'piiq'
|
| 30 |
+
- 'andrewkenreich'
|
| 31 |
+
- 'IgorWounds'
|
| 32 |
+
- 'minhhoang1023'
|
| 33 |
+
|
| 34 |
+
template: |
|
| 35 |
+
## Thank you and welcome to our new contributors 🔥
|
| 36 |
+
$CONTRIBUTORS
|
| 37 |
+
|
| 38 |
+
## Summary 🎉
|
| 39 |
+
|
| 40 |
+
## What's changed 🚀
|
| 41 |
+
$CHANGES
|
| 42 |
+
|
| 43 |
+
We are proud of our community contributors and staunch supporters of open-source ecosystems.
|
| 44 |
+
Help us promote our community by tagging `@openbb_finance` on X with a link to your pull request,
|
| 45 |
+
and join our Discord server to chat about your contribution! We want to hear about your experience!
|
| 46 |
+
|
| 47 |
+
### Links 🦋
|
| 48 |
+
[Website](https://openbb.co/), [Twitter](https://twitter.com/openbb_finance), [Linkedin](https://www.linkedin.com/company/openbb-finance), [Instagram](https://www.instagram.com/openbb.finance/), [Reddit](https://www.reddit.com/r/openbb/), [Discord](https://discord.com/invite/xPHTuHCmuV)
|
.github/scripts/noxfile.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Nox sessions."""
|
| 2 |
+
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
|
| 5 |
+
import nox
|
| 6 |
+
|
| 7 |
+
ROOT_DIR = Path(__file__).parent.parent.parent
|
| 8 |
+
PLATFORM_DIR = ROOT_DIR / "openbb_platform"
|
| 9 |
+
PLATFORM_TESTS = [
|
| 10 |
+
str(PLATFORM_DIR / p) for p in ["tests", "core", "providers", "extensions"]
|
| 11 |
+
]
|
| 12 |
+
CLI_DIR = ROOT_DIR / "cli"
|
| 13 |
+
CLI_TESTS = CLI_DIR / "tests"
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
|
| 17 |
+
def unit_test_platform(session):
|
| 18 |
+
"""Run the test suite."""
|
| 19 |
+
session.install("poetry", "toml")
|
| 20 |
+
session.run(
|
| 21 |
+
"python",
|
| 22 |
+
str(PLATFORM_DIR / "dev_install.py"),
|
| 23 |
+
"-e",
|
| 24 |
+
"all",
|
| 25 |
+
external=True,
|
| 26 |
+
)
|
| 27 |
+
session.install("pytest")
|
| 28 |
+
session.install("pytest-cov")
|
| 29 |
+
session.run(
|
| 30 |
+
"pytest", *PLATFORM_TESTS, f"--cov={PLATFORM_DIR}", "-m", "not integration"
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
|
| 35 |
+
def unit_test_cli(session):
|
| 36 |
+
"""Run the test suite."""
|
| 37 |
+
session.install("poetry", "toml")
|
| 38 |
+
session.run(
|
| 39 |
+
"python",
|
| 40 |
+
str(PLATFORM_DIR / "dev_install.py"),
|
| 41 |
+
"-e",
|
| 42 |
+
"all",
|
| 43 |
+
external=True,
|
| 44 |
+
)
|
| 45 |
+
session.install("pytest")
|
| 46 |
+
session.install("pytest-cov")
|
| 47 |
+
session.run("pytest", CLI_TESTS, f"--cov={CLI_DIR}")
|
.github/scripts/process_changelog.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# process_changelog.py
|
| 2 |
+
import logging
|
| 3 |
+
import re
|
| 4 |
+
import sys
|
| 5 |
+
|
| 6 |
+
# Set up basic configuration for logging
|
| 7 |
+
logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def process_changelog(file_path, release_pr_number):
|
| 11 |
+
# Attempt to open and read the file content
|
| 12 |
+
try:
|
| 13 |
+
with open(file_path) as file: # Default mode is 'r' for read
|
| 14 |
+
lines = file.readlines()
|
| 15 |
+
except OSError as e: # Catching file I/O errors
|
| 16 |
+
logging.error(f"Failed to open or read file: {e}")
|
| 17 |
+
return
|
| 18 |
+
|
| 19 |
+
pr_occurrences = {} # Dictionary to track occurrences of PR numbers
|
| 20 |
+
|
| 21 |
+
# Iterate through each line to find PR numbers
|
| 22 |
+
for i, line in enumerate(lines):
|
| 23 |
+
match = re.search(r"\(#(\d+)\)", line) # Regex to find PR numbers
|
| 24 |
+
if match:
|
| 25 |
+
pr_number = int(match.group(1))
|
| 26 |
+
# Add line index to the list of occurrences for the PR number
|
| 27 |
+
if pr_number not in pr_occurrences:
|
| 28 |
+
pr_occurrences[pr_number] = []
|
| 29 |
+
pr_occurrences[pr_number].append(i)
|
| 30 |
+
|
| 31 |
+
# Set of indices to remove: includes all but last occurrence of each PR number
|
| 32 |
+
to_remove = {
|
| 33 |
+
i
|
| 34 |
+
for pr, indices in pr_occurrences.items()
|
| 35 |
+
if len(indices) > 1
|
| 36 |
+
for i in indices[:-1]
|
| 37 |
+
}
|
| 38 |
+
# Also remove any PR entries less than or equal to the specified release PR number
|
| 39 |
+
to_remove.update(
|
| 40 |
+
i
|
| 41 |
+
for pr, indices in pr_occurrences.items()
|
| 42 |
+
for i in indices
|
| 43 |
+
if pr <= release_pr_number
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
# Filter out lines marked for removal
|
| 47 |
+
processed_lines = [line for i, line in enumerate(lines) if i not in to_remove]
|
| 48 |
+
|
| 49 |
+
# Final sweep: Ensure no missed duplicates, keeping only the last occurrence
|
| 50 |
+
final_lines = []
|
| 51 |
+
seen_pr_numbers = set() # Track seen PR numbers to identify duplicates
|
| 52 |
+
for line in reversed(
|
| 53 |
+
processed_lines
|
| 54 |
+
): # Start from the end to keep the last occurrence
|
| 55 |
+
match = re.search(r"\(#(\d+)\)", line)
|
| 56 |
+
if match:
|
| 57 |
+
pr_number = int(match.group(1))
|
| 58 |
+
if pr_number in seen_pr_numbers:
|
| 59 |
+
continue # Skip duplicate entries
|
| 60 |
+
seen_pr_numbers.add(pr_number)
|
| 61 |
+
final_lines.append(line)
|
| 62 |
+
final_lines.reverse() # Restore original order
|
| 63 |
+
|
| 64 |
+
# Write the processed lines back to the file
|
| 65 |
+
try:
|
| 66 |
+
with open(file_path, "w") as file:
|
| 67 |
+
file.writelines(final_lines)
|
| 68 |
+
except OSError as e: # Handling potential write errors
|
| 69 |
+
logging.error(f"Failed to write to file: {e}")
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
if __name__ == "__main__":
|
| 73 |
+
# Ensure correct command line arguments
|
| 74 |
+
if len(sys.argv) < 3:
|
| 75 |
+
logging.error(
|
| 76 |
+
"Usage: python process_changelog.py <changelog_file> <release_pr_number>"
|
| 77 |
+
)
|
| 78 |
+
sys.exit(1)
|
| 79 |
+
|
| 80 |
+
file_path = sys.argv[1]
|
| 81 |
+
release_pr_number = int(sys.argv[2])
|
| 82 |
+
process_changelog(file_path, release_pr_number)
|
.github/scripts/summarize_changelog.py
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Changelog v2 summary generator."""
|
| 2 |
+
|
| 3 |
+
import logging
|
| 4 |
+
import re
|
| 5 |
+
import sys
|
| 6 |
+
from typing import Dict
|
| 7 |
+
|
| 8 |
+
import requests
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def fetch_pr_details(owner: str, repo: str, pr_number: str, github_token: str) -> dict:
|
| 12 |
+
"""Fetch details of a specific PR from GitHub."""
|
| 13 |
+
url = f"https://api.github.com/repos/{owner}/{repo}/pulls/{pr_number}"
|
| 14 |
+
headers = {"Authorization": f"token {github_token}"}
|
| 15 |
+
response = requests.get(url, headers=headers, timeout=10)
|
| 16 |
+
if response.status_code == 200:
|
| 17 |
+
return response.json()
|
| 18 |
+
|
| 19 |
+
logging.error(
|
| 20 |
+
"Failed to fetch PR details for PR #%s. Status code: %s",
|
| 21 |
+
pr_number,
|
| 22 |
+
response.status_code,
|
| 23 |
+
)
|
| 24 |
+
return {}
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def parse_and_fetch_pr_details(
|
| 28 |
+
markdown_text: str, owner: str, repo: str, github_token: str
|
| 29 |
+
) -> Dict[str, str]:
|
| 30 |
+
"""Parse the markdown text and fetch details of PRs mentioned in the text."""
|
| 31 |
+
sections = re.split(r"\n## ", markdown_text)
|
| 32 |
+
categories: Dict[str, str] = {}
|
| 33 |
+
|
| 34 |
+
for section in sections:
|
| 35 |
+
split_section = section.split("\n", 1)
|
| 36 |
+
if len(split_section) < 2:
|
| 37 |
+
continue
|
| 38 |
+
|
| 39 |
+
category_name = split_section[0].strip()
|
| 40 |
+
items_text = split_section[1].strip()
|
| 41 |
+
items = re.findall(r"- (?:\[.*?\] - )?(.*?) @.*? \(#(\d+)\)", items_text)
|
| 42 |
+
|
| 43 |
+
for _, pr_number in items:
|
| 44 |
+
pr_details = fetch_pr_details(owner, repo, pr_number, github_token)
|
| 45 |
+
if pr_details:
|
| 46 |
+
try:
|
| 47 |
+
pr_info = {
|
| 48 |
+
"title": pr_details["title"],
|
| 49 |
+
"body": re.sub(r"\s+", " ", pr_details["body"].strip()).strip(),
|
| 50 |
+
}
|
| 51 |
+
except Exception as e:
|
| 52 |
+
logging.error(
|
| 53 |
+
"Failed to fetch PR details for PR #%s: %s", pr_number, e
|
| 54 |
+
)
|
| 55 |
+
if category_name in categories:
|
| 56 |
+
categories[category_name].append(pr_info) # type: ignore
|
| 57 |
+
else:
|
| 58 |
+
categories[category_name] = [pr_info] # type: ignore
|
| 59 |
+
|
| 60 |
+
return categories
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def insert_summary_into_markdown(
|
| 64 |
+
markdown_text: str, category_name: str, summary: str
|
| 65 |
+
) -> str:
|
| 66 |
+
"""Insert a summary into the markdown text directly under the specified category name."""
|
| 67 |
+
marker = f"## {category_name}"
|
| 68 |
+
if marker in markdown_text:
|
| 69 |
+
# Find the position right after the category name
|
| 70 |
+
start_pos = markdown_text.find(marker) + len(marker)
|
| 71 |
+
# Find the position of the first newline after the category name to ensure we insert before any content
|
| 72 |
+
newline_pos = markdown_text.find("\n", start_pos)
|
| 73 |
+
if newline_pos != -1:
|
| 74 |
+
# Insert the summary right after the newline that follows the category name
|
| 75 |
+
# Ensuring it's on a new line and followed by two newlines before any subsequent content
|
| 76 |
+
updated_markdown = (
|
| 77 |
+
markdown_text[: newline_pos + 1]
|
| 78 |
+
+ "\n"
|
| 79 |
+
+ summary
|
| 80 |
+
+ markdown_text[newline_pos + 1 :]
|
| 81 |
+
)
|
| 82 |
+
else:
|
| 83 |
+
# If there's no newline (e.g., end of file), just append the summary
|
| 84 |
+
updated_markdown = markdown_text + "\n\n" + summary + "\n"
|
| 85 |
+
return updated_markdown
|
| 86 |
+
|
| 87 |
+
logging.error("Category '%s' not found in markdown.", category_name)
|
| 88 |
+
return markdown_text
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
def summarize_text_with_openai(text: str, openai_api_key: str) -> str:
|
| 92 |
+
"""Summarize text using OpenAI's GPT model."""
|
| 93 |
+
from openai import OpenAI # pylint: disable=C0415
|
| 94 |
+
|
| 95 |
+
openai = OpenAI(api_key=openai_api_key)
|
| 96 |
+
response = openai.chat.completions.create(
|
| 97 |
+
model="gpt-4", # noqa: E501
|
| 98 |
+
messages=[
|
| 99 |
+
{
|
| 100 |
+
"role": "system",
|
| 101 |
+
"content": "Summarize the following text in a concise way to describe what happened in the new release. This will be used on top of the changelog to provide a high-level overview of the changes. Make sure it is well-written, concise, structured and that it captures the essence of the text. It should read like a concise story.", # noqa: E501 # pylint: disable=C0301
|
| 102 |
+
},
|
| 103 |
+
{"role": "user", "content": text},
|
| 104 |
+
],
|
| 105 |
+
)
|
| 106 |
+
return response.choices[0].message.content # type: ignore
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
def summarize_changelog_v2(
|
| 110 |
+
github_token: str,
|
| 111 |
+
openai_api_key: str,
|
| 112 |
+
owner: str = "OpenBB-finance",
|
| 113 |
+
repo: str = "OpenBBTerminal",
|
| 114 |
+
changelog_v2: str = "CHANGELOG.md",
|
| 115 |
+
) -> None:
|
| 116 |
+
"""Summarize the Changelog v2 markdown text with PR details."""
|
| 117 |
+
try:
|
| 118 |
+
with open(changelog_v2) as file:
|
| 119 |
+
logging.info("Reading file: %s", changelog_v2)
|
| 120 |
+
data = file.read()
|
| 121 |
+
except OSError as e:
|
| 122 |
+
logging.error("Failed to open or read file: %s", e)
|
| 123 |
+
return
|
| 124 |
+
|
| 125 |
+
logging.info("Parsing and fetching PR details...")
|
| 126 |
+
categories = parse_and_fetch_pr_details(data, owner, repo, github_token)
|
| 127 |
+
|
| 128 |
+
categories_of_interest = [
|
| 129 |
+
"🚨 OpenBB Platform Breaking Changes",
|
| 130 |
+
"🦋 OpenBB Platform Enhancements",
|
| 131 |
+
"🐛 OpenBB Platform Bug Fixes",
|
| 132 |
+
"📚 OpenBB Documentation Changes",
|
| 133 |
+
]
|
| 134 |
+
updated_markdown = data
|
| 135 |
+
|
| 136 |
+
logging.info("Summarizing text with OpenAI...")
|
| 137 |
+
for category_of_interest in categories_of_interest:
|
| 138 |
+
if category_of_interest in categories:
|
| 139 |
+
pattern = r"\[.*?\]\(.*?\)|[*_`]"
|
| 140 |
+
aggregated_text = "\n".join(
|
| 141 |
+
[
|
| 142 |
+
f"- {pr['title']}: {re.sub(pattern, '', pr['body'])}" # type: ignore
|
| 143 |
+
for pr in categories[category_of_interest] # type: ignore
|
| 144 |
+
]
|
| 145 |
+
)
|
| 146 |
+
summary = summarize_text_with_openai(aggregated_text, openai_api_key)
|
| 147 |
+
updated_markdown = insert_summary_into_markdown(
|
| 148 |
+
updated_markdown, category_of_interest, summary
|
| 149 |
+
)
|
| 150 |
+
|
| 151 |
+
with open(changelog_v2, "w") as file:
|
| 152 |
+
logging.info("Writing updated file: %s", changelog_v2)
|
| 153 |
+
file.write(updated_markdown)
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
if __name__ == "__main__":
|
| 157 |
+
if len(sys.argv) < 3:
|
| 158 |
+
logging.error(
|
| 159 |
+
"Usage: python summarize_changelog.py <github_token> <openai_api_key>"
|
| 160 |
+
)
|
| 161 |
+
sys.exit(1)
|
| 162 |
+
|
| 163 |
+
token = sys.argv[1]
|
| 164 |
+
openai_key = sys.argv[2]
|
| 165 |
+
|
| 166 |
+
summarize_changelog_v2(github_token=token, openai_api_key=openai_key)
|
.github/workflows/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OpenBB Workflows
|
| 2 |
+
|
| 3 |
+
This directory contains the workflows for the OpenBB 🦋 Project. The workflows are:
|
| 4 |
+
|
| 5 |
+
## 📑 Deploy to GitHub Pages
|
| 6 |
+
|
| 7 |
+
This GitHub Actions workflow is responsible for building the documentation and deploying it to GitHub Pages. This workflow is triggered when a new change is pushed to the `main` or `release` branch of the repository, and the documentation is published to GitHub Pages.
|
| 8 |
+
|
| 9 |
+
## Branch Name Check
|
| 10 |
+
|
| 11 |
+
Objective: To check if pull request branch names follow the GitFlow naming convention before merging.
|
| 12 |
+
|
| 13 |
+
Triggered by: A pull request event where the target branch is either develop or main.
|
| 14 |
+
|
| 15 |
+
Branches checked: The source branch of a pull request and the target branch of a pull request.
|
| 16 |
+
|
| 17 |
+
Steps:
|
| 18 |
+
|
| 19 |
+
1. Extract branch names: Using the jq tool, the source and target branch names are extracted from the pull request event. The branch names are then stored in environment variables and printed as output.
|
| 20 |
+
|
| 21 |
+
2. Show Output result for source-branch and target-branch: The source and target branch names are printed to the console.
|
| 22 |
+
|
| 23 |
+
3. Check branch name for develop PRs: If the target branch is develop, then the source branch is checked against a regular expression to ensure that it follows the GitFlow naming convention. If the branch name is invalid, a message is printed to the console and the workflow exits with a status code of 1.
|
| 24 |
+
|
| 25 |
+
4. Check branch name for main PRs: If the target branch is main, then the source branch is checked against a regular expression to ensure that it is either a hotfix or a release branch. If the branch name is invalid, a message is printed to the console and the workflow exits with a status code of 1.
|
| 26 |
+
|
| 27 |
+
Note: The GitFlow naming convention for branches is as follows:
|
| 28 |
+
|
| 29 |
+
- Feature branches: feature/<feature-name>
|
| 30 |
+
- Hotfix branches: hotfix/<hotfix-name>
|
| 31 |
+
- Release branches: release/<major.minor.patch>(rc<number>)
|
| 32 |
+
|
| 33 |
+
## Deploy to PyPI - Nightly
|
| 34 |
+
|
| 35 |
+
This workflow is used to publish the latest version of the OpenBB Platform CLI to PyPI. The workflow is triggered at UTC+0 daily by the GitHub Action schedule event.
|
| 36 |
+
|
| 37 |
+
It does this by first updating the `pyproject.toml` file with a pre-determined version string of the form `<currentVersion>.dev<date>`, where `<date>` represents the current day's date as a 8 digit number.
|
| 38 |
+
|
| 39 |
+
Then, the code installs `pypa/build` and uses `python -m build` to create a binary wheel and a source tarball in the `dist/` directory.
|
| 40 |
+
|
| 41 |
+
Finally, it uses the PyPA specific action `gh-action-pypi-publish` to publish the created files to PyPI.
|
| 42 |
+
|
| 43 |
+
## Deploy the OpenBB Platform to Test PyPI
|
| 44 |
+
|
| 45 |
+
The Github Action code `Deploy to PyPI` is used to deploy a Python project to PyPI (Python Package Index) and TestPyPI, which is a separate package index for testing purposes. The code is triggered on two events:
|
| 46 |
+
|
| 47 |
+
1. Push event: The code is triggered whenever there is a push to the `release/*` and `main` branches.
|
| 48 |
+
|
| 49 |
+
2. Workflow dispatch event: The code can be manually triggered by the workflow dispatch event.
|
| 50 |
+
|
| 51 |
+
The code sets the concurrency to the `group` and the option `cancel-in-progress` is set to `true` to ensure that the running jobs in the same `group` are cancelled in case another job is triggered.
|
| 52 |
+
|
| 53 |
+
The code contains two jobs, `deploy-test-pypi` and `deploy-pypi`, both of which have the same steps with slight variations.
|
| 54 |
+
|
| 55 |
+
The `deploy-test-pypi` job is triggered only if the pushed branch starts with `refs/heads/release/`. This job sets up the Python environment, installs the `build` package using `pip`, builds binary wheel and source tarball using `build`, and finally, publishes the distributions to TestPyPI using the `pypa/gh-action-pypi-publish@release/v1` Github Action. The `password` to access TestPyPI is stored as a secret named `TEST_PYPI_API_TOKEN`.
|
| 56 |
+
|
| 57 |
+
Similarly, the `deploy-pypi` job is triggered only if the pushed branch starts with `refs/heads/main`. This job follows the same steps as `deploy-test-pypi`, but the distributions are published to PyPI instead of TestPyPI. The `password` to access PyPI is stored as a secret named `PYPI_API_TOKEN`.
|
| 58 |
+
|
| 59 |
+
Note: The code uses the `pypa/build` package for building the binary wheel and source tarball, and the `pypa/gh-action-pypi-publish@release/v1` Github Action for publishing the distributions to PyPI and TestPyPI.
|
| 60 |
+
|
| 61 |
+
## Draft release
|
| 62 |
+
|
| 63 |
+
This GitHub Actions workflow is designed to automatically generate and update draft releases in a GitHub repository. The workflow is triggered when it is manually dispatched, allowing you to control when the draft releases are updated.
|
| 64 |
+
|
| 65 |
+
## 🧹 General Linting
|
| 66 |
+
|
| 67 |
+
This GitHub Actions workflow is responsible for running linting checks on the codebase. This workflow is triggered on pull request events such as `opened`, `synchronize`, and `edited`, and push events on branches with names that start with `feature/`, `hotfix/`, or `release/`. The workflow also sets a number of environment variables and uses Github Actions caching to improve performance.
|
| 68 |
+
|
| 69 |
+
It consists of two jobs: `code-linting` and `markdown-link-check`.
|
| 70 |
+
|
| 71 |
+
The first job, `code-linting`, runs on an Ubuntu machine and performs several linting tasks on the code in the repository, including:
|
| 72 |
+
|
| 73 |
+
- Checking out the code from the repository
|
| 74 |
+
- Setting up Python 3.10
|
| 75 |
+
- Installing a number of Python packages necessary for the linting tasks
|
| 76 |
+
- Running `bandit` to check for security vulnerabilities
|
| 77 |
+
- Running `black` to check the code formatting
|
| 78 |
+
- Running `codespell` to check the spelling of comments, strings, and variable names
|
| 79 |
+
- Running `ruff` to check the use of Python
|
| 80 |
+
- Running `pylint` to perform static analysis of the code
|
| 81 |
+
- Running `mypy` to check the type annotations
|
| 82 |
+
- Running `pydocstyle` to check the docstrings
|
| 83 |
+
|
| 84 |
+
The second job, `markdown-link-check`, runs on an Ubuntu machine and performs linting of the markdown files in the repository. It uses a Docker container `avtodev/markdown-lint` to perform the linting.
|
| 85 |
+
|
| 86 |
+
## 🏷️ Pull Request Labels
|
| 87 |
+
|
| 88 |
+
Automatic labelling of pull requests.
|
| 89 |
+
|
| 90 |
+
## 🚉 Integration test Platform (API)
|
| 91 |
+
|
| 92 |
+
Run `openbb_platform` API integration tests,
|
| 93 |
+
|
| 94 |
+
## 🖥️ Unit test CLI
|
| 95 |
+
|
| 96 |
+
Run `cli` directory unit tests.
|
| 97 |
+
|
| 98 |
+
## 🚉 Unit test Platform
|
| 99 |
+
|
| 100 |
+
Run `openbb_platform` directory unit tests - providers, extensions, etc.
|
.github/workflows/deploy-pypi-nightly.yml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Deploy to PyPI - Nightly
|
| 2 |
+
|
| 3 |
+
on: workflow_dispatch
|
| 4 |
+
|
| 5 |
+
concurrency:
|
| 6 |
+
group: ${{ github.workflow }}-${{ github.ref }}
|
| 7 |
+
cancel-in-progress: true
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
deploy-nightly-pypi:
|
| 11 |
+
name: Build and publish nightly distributions 📦 to PyPI
|
| 12 |
+
runs-on: ubuntu-latest
|
| 13 |
+
|
| 14 |
+
steps:
|
| 15 |
+
- uses: actions/checkout@v4
|
| 16 |
+
- name: Setup Python 3.10
|
| 17 |
+
uses: actions/setup-python@v5
|
| 18 |
+
with:
|
| 19 |
+
python-version: "3.10"
|
| 20 |
+
|
| 21 |
+
- name: Install pypa/build
|
| 22 |
+
run: >-
|
| 23 |
+
python -m
|
| 24 |
+
pip install
|
| 25 |
+
build
|
| 26 |
+
|
| 27 |
+
- name: OpenBB Platform - Update version in pyproject.toml and Edit docs
|
| 28 |
+
run: |
|
| 29 |
+
sed -i 's/name = ".*"/name = "openbb-nightly"/' openbb_platform/pyproject.toml
|
| 30 |
+
sed -i "3s/version = \"\(.*\)\"/version = \"\1.dev$(date +%Y%m%d%H%M)\"/" openbb_platform/pyproject.toml
|
| 31 |
+
|
| 32 |
+
- name: OpenBB Platform - Create the dynamically generated wheel
|
| 33 |
+
run: |
|
| 34 |
+
python -m pip install poetry toml
|
| 35 |
+
python build/pypi/openbb_platform/nightly.py
|
| 36 |
+
|
| 37 |
+
- name: OpenBB Platform - Publish distribution 📦 to PyPI
|
| 38 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
| 39 |
+
with:
|
| 40 |
+
packages-dir: openbb_platform/dist/
|
| 41 |
+
password: ${{ secrets.NIGHTLY_PYPI_API_TOKEN }}
|
.github/workflows/deploy-test-pypi.yml
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Deploy the OpenBB Platform to Test PyPI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches:
|
| 6 |
+
- feature/v4-pypi
|
| 7 |
+
|
| 8 |
+
concurrency:
|
| 9 |
+
group: ${{ github.workflow }}-${{ github.ref }}
|
| 10 |
+
cancel-in-progress: true
|
| 11 |
+
|
| 12 |
+
jobs:
|
| 13 |
+
deploy-test-pypi:
|
| 14 |
+
name: Build and publish 📦 to TestPyPI
|
| 15 |
+
runs-on: ubuntu-latest
|
| 16 |
+
|
| 17 |
+
steps:
|
| 18 |
+
- uses: actions/checkout@v4
|
| 19 |
+
- name: Setup Python 3.10
|
| 20 |
+
uses: actions/setup-python@v5
|
| 21 |
+
with:
|
| 22 |
+
python-version: "3.10"
|
| 23 |
+
|
| 24 |
+
- name: Install pypa/build
|
| 25 |
+
run: >-
|
| 26 |
+
python -m
|
| 27 |
+
pip install
|
| 28 |
+
build
|
| 29 |
+
--user
|
| 30 |
+
|
| 31 |
+
- name: OpenBBTerminal - Update version in pyproject.toml and Edit docs
|
| 32 |
+
run: |
|
| 33 |
+
sed -i 's/name = ".*"/name = "openbb-terminal-nightly"/' pyproject.toml
|
| 34 |
+
sed -i "3s/version = \"\(.*\)\"/version = \"\1.dev$(date +%Y%m%d%H%M)\"/" pyproject.toml
|
| 35 |
+
sed -i 's|pip install openbb-terminal|pip install openbb-terminal-nightly|g' ./website/pypi.md
|
| 36 |
+
|
| 37 |
+
- name: OpenBBTerminal - Build a binary wheel and a source tarball
|
| 38 |
+
run: >-
|
| 39 |
+
python -m
|
| 40 |
+
build
|
| 41 |
+
--sdist
|
| 42 |
+
--wheel
|
| 43 |
+
--outdir dist/
|
| 44 |
+
.
|
| 45 |
+
|
| 46 |
+
- name: OpenBBTerminal - Publish distribution 📦 to Test PyPI
|
| 47 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
| 48 |
+
with:
|
| 49 |
+
packages-dir: dist/
|
| 50 |
+
password: ${{ secrets.TEST_PYPI_API_TOKEN_OBB_TERMINAL_NIGHTLY }}
|
| 51 |
+
repository-url: https://test.pypi.org/legacy/
|
| 52 |
+
|
| 53 |
+
- name: OpenBB Platform - Update version in pyproject.toml and Edit docs
|
| 54 |
+
run: |
|
| 55 |
+
sed -i 's/name = ".*"/name = "openbb-nightly"/' openbb_platform/pyproject.toml
|
| 56 |
+
sed -i "3s/version = \"\(.*\)\"/version = \"\1.dev$(date +%Y%m%d%H%M)\"/" openbb_platform/pyproject.toml
|
| 57 |
+
|
| 58 |
+
- name: OpenBB Platform - Create the dynamically generated wheel
|
| 59 |
+
run: |
|
| 60 |
+
python -m pip install poetry toml
|
| 61 |
+
python build/pypi/openbb_platform/nightly.py
|
| 62 |
+
|
| 63 |
+
- name: OpenBB Platform - Publish distribution 📦 to Test PyPI
|
| 64 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
| 65 |
+
with:
|
| 66 |
+
packages-dir: openbb_platform/dist/
|
| 67 |
+
password: ${{ secrets.TEST_PYPI_API_TOKEN_OBB_PLATFORM_NIGHTLY }}
|
| 68 |
+
repository-url: https://test.pypi.org/legacy/
|
.github/workflows/draft-release.yml
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 📝 Draft release changelog
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
workflow_dispatch:
|
| 5 |
+
inputs:
|
| 6 |
+
release_pr_number:
|
| 7 |
+
description: "Previous Release PR Number"
|
| 8 |
+
required: true
|
| 9 |
+
default: ""
|
| 10 |
+
tag:
|
| 11 |
+
description: "Tag for release (manual input)"
|
| 12 |
+
required: true
|
| 13 |
+
default: ""
|
| 14 |
+
|
| 15 |
+
jobs:
|
| 16 |
+
update_release_draft:
|
| 17 |
+
runs-on: ubuntu-latest
|
| 18 |
+
steps:
|
| 19 |
+
- name: 📟 Checkout code
|
| 20 |
+
uses: actions/checkout@v4
|
| 21 |
+
|
| 22 |
+
- name: 📝 Release Drafter
|
| 23 |
+
id: release-drafter
|
| 24 |
+
uses: release-drafter/release-drafter@v6.0.0
|
| 25 |
+
# with:
|
| 26 |
+
# config-name: platform-drafter.yml
|
| 27 |
+
env:
|
| 28 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 29 |
+
|
| 30 |
+
- name: 💾 Save Changelog
|
| 31 |
+
run: |
|
| 32 |
+
cat << 'EOF' > CHANGELOG.md
|
| 33 |
+
${{ steps.release-drafter.outputs.body }}
|
| 34 |
+
EOF
|
| 35 |
+
|
| 36 |
+
- name: 🧬 Process Changelog
|
| 37 |
+
run: |
|
| 38 |
+
pip install requests openai
|
| 39 |
+
python .github/scripts/process_changelog.py CHANGELOG.md ${{ github.event.inputs.release_pr_number }}
|
| 40 |
+
python .github/scripts/summarize_changelog.py ${{ secrets.GITHUB_TOKEN }} ${{ secrets.OPENAI_API_KEY }}
|
| 41 |
+
cat CHANGELOG.md
|
| 42 |
+
|
| 43 |
+
- name: 🛫 Create Release
|
| 44 |
+
uses: mikepenz/action-gh-release@v1
|
| 45 |
+
with:
|
| 46 |
+
body_path: "CHANGELOG.md"
|
| 47 |
+
tag_name: ${{ github.event.inputs.tag }}
|
| 48 |
+
prerelease: false
|
| 49 |
+
draft: true
|
| 50 |
+
env:
|
| 51 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
.github/workflows/general-linting.yml
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 🧹 General Linting
|
| 2 |
+
|
| 3 |
+
env:
|
| 4 |
+
PIP_DEFAULT_TIMEOUT: 100
|
| 5 |
+
|
| 6 |
+
on:
|
| 7 |
+
pull_request:
|
| 8 |
+
types: [opened, synchronize, edited]
|
| 9 |
+
# push:
|
| 10 |
+
# branches:
|
| 11 |
+
# - "feature/*"
|
| 12 |
+
# - "hotfix/*"
|
| 13 |
+
# - "release/*"
|
| 14 |
+
merge_group:
|
| 15 |
+
types: [checks_requested]
|
| 16 |
+
|
| 17 |
+
# Cancel previous runs that are not yet completed.
|
| 18 |
+
concurrency:
|
| 19 |
+
group: ${{ github.event_name }}-${{ github.repository }}-${{ github.ref }}
|
| 20 |
+
cancel-in-progress: true
|
| 21 |
+
|
| 22 |
+
jobs:
|
| 23 |
+
code-linting:
|
| 24 |
+
name: General Code Linting
|
| 25 |
+
runs-on: ubuntu-latest
|
| 26 |
+
steps:
|
| 27 |
+
- name: Checkout Code
|
| 28 |
+
uses: actions/checkout@v4.1.1 # actions/checkout v3.0.2
|
| 29 |
+
with:
|
| 30 |
+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
|
| 31 |
+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
|
| 32 |
+
fetch-depth: 20
|
| 33 |
+
token: ${{ secrets.GITHUB_TOKEN }}
|
| 34 |
+
|
| 35 |
+
- name: Fetch base branch
|
| 36 |
+
run: git fetch --no-tags --depth=20 origin ${{ github.base_ref }}
|
| 37 |
+
|
| 38 |
+
- name: Setup Python 3.10
|
| 39 |
+
uses: actions/setup-python@v5
|
| 40 |
+
with:
|
| 41 |
+
python-version: "3.10"
|
| 42 |
+
architecture: x64
|
| 43 |
+
|
| 44 |
+
- name: Get changed files in openbb_platform for PR
|
| 45 |
+
if: github.event_name == 'pull_request'
|
| 46 |
+
run: |
|
| 47 |
+
# "Checking PR diff"
|
| 48 |
+
echo "diff_files=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep -E '^(openbb_platform|cli)/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV
|
| 49 |
+
echo $diff_files
|
| 50 |
+
|
| 51 |
+
- uses: actions/cache@v4
|
| 52 |
+
with:
|
| 53 |
+
path: ~/.cache/pip
|
| 54 |
+
key: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}
|
| 55 |
+
restore-keys: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}
|
| 56 |
+
|
| 57 |
+
- run: |
|
| 58 |
+
pip install openbb-devtools
|
| 59 |
+
pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil types-setuptools types-six
|
| 60 |
+
- run: bandit -x ./tests -r . || true
|
| 61 |
+
- run: codespell --ignore-words=.codespell.ignore --skip="$(tr '\n' ',' < .codespell.skip | sed 's/,$//')" --quiet-level=2
|
| 62 |
+
- run: |
|
| 63 |
+
# Run linters for openbb_platform | cli
|
| 64 |
+
if [ -n "${{ env.diff_files }}" ]; then
|
| 65 |
+
black --diff --check ${{ env.diff_files }}
|
| 66 |
+
mypy ${{ env.diff_files }} --ignore-missing-imports --scripts-are-modules --check-untyped-defs
|
| 67 |
+
pydocstyle ${{ env.diff_files }}
|
| 68 |
+
pylint ${{ env.diff_files }}
|
| 69 |
+
ruff check ${{ env.diff_files }}
|
| 70 |
+
else
|
| 71 |
+
echo "No Python files changed in openbb_platform | cli"
|
| 72 |
+
fi
|
| 73 |
+
|
| 74 |
+
markdown-link-check:
|
| 75 |
+
name: Markdown Linting
|
| 76 |
+
runs-on: ubuntu-latest
|
| 77 |
+
steps:
|
| 78 |
+
- uses: actions/checkout@v4
|
| 79 |
+
name: Check out the code
|
| 80 |
+
- name: Lint Code Base
|
| 81 |
+
uses: docker://avtodev/markdown-lint:v1
|
| 82 |
+
with:
|
| 83 |
+
args: "./*.md ./changelogs/*.md ./openbb_terminal/**/*.md ./discordbot/**/*.md"
|
| 84 |
+
|
| 85 |
+
json-yaml-validate:
|
| 86 |
+
name: JSON Check
|
| 87 |
+
runs-on: ubuntu-latest
|
| 88 |
+
steps:
|
| 89 |
+
- uses: actions/checkout@v4
|
| 90 |
+
|
| 91 |
+
- name: json-yaml-validate
|
| 92 |
+
id: json-yaml-validate
|
| 93 |
+
uses: GrantBirki/json-yaml-validate@v2.0.0
|
| 94 |
+
with:
|
| 95 |
+
yaml_exclude_regex: "construct.yaml"
|
| 96 |
+
use_gitignore: false
|
.github/workflows/gh-branch-name-check.yml
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Branch Name Check
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request:
|
| 5 |
+
branches:
|
| 6 |
+
- develop
|
| 7 |
+
- main
|
| 8 |
+
types: [opened, synchronize, edited]
|
| 9 |
+
|
| 10 |
+
concurrency:
|
| 11 |
+
group: ${{ github.workflow }}-${{ github.ref }}
|
| 12 |
+
cancel-in-progress: true
|
| 13 |
+
|
| 14 |
+
jobs:
|
| 15 |
+
check-branch-name:
|
| 16 |
+
runs-on: ubuntu-latest
|
| 17 |
+
steps:
|
| 18 |
+
- name: Checkout code
|
| 19 |
+
uses: actions/checkout@v4
|
| 20 |
+
|
| 21 |
+
- name: Get branch names.
|
| 22 |
+
id: branch-names
|
| 23 |
+
uses: tj-actions/branch-names@v8
|
| 24 |
+
|
| 25 |
+
- name: Show Output result for source-branch and target-branch
|
| 26 |
+
run: |
|
| 27 |
+
echo "source-branch=${{ steps.branch-names.outputs.head_ref_branch }}"
|
| 28 |
+
echo "target-branch=${{ steps.branch-names.outputs.base_ref_branch }}"
|
| 29 |
+
|
| 30 |
+
- name: Check branch name for develop PRs
|
| 31 |
+
id: check-develop-branch
|
| 32 |
+
if: ${{ steps.branch-names.outputs.base_ref_branch == 'develop' && !github.event.pull_request.head.repo.fork }}
|
| 33 |
+
run: |
|
| 34 |
+
if ! [[ "${{ steps.branch-names.outputs.head_ref_branch }}" =~ ^(feature/.*|docs/.*|bugfix/.*|hotfix/.*|release/([a-zA-Z-]+-)?[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?)$ ]]; then
|
| 35 |
+
echo "reason=Invalid branch name for a Pull Request to be merged to `${{ steps.branch-names.outputs.base_ref_branch }}` branch. Branches must follow the GitFlow naming convention." >> $GITHUB_OUTPUT
|
| 36 |
+
fi
|
| 37 |
+
|
| 38 |
+
- name: Check branch name for main PRs
|
| 39 |
+
id: check-main-branch
|
| 40 |
+
if: ${{ steps.branch-names.outputs.base_ref_branch == 'main' }}
|
| 41 |
+
run: |
|
| 42 |
+
if ! [[ "${{ steps.branch-names.outputs.head_ref_branch }}" =~ ^(hotfix/.*|docs/.*|release/([a-zA-Z-]+-)?[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?)$ ]]; then
|
| 43 |
+
echo "reason=Invalid branch name for a Pull Request to be merged to `${{ steps.branch-names.outputs.base_ref_branch }}` branch. Pull requests must be from a hotfix or release branch." >> $GITHUB_OUTPUT
|
| 44 |
+
fi
|
| 45 |
+
|
| 46 |
+
- name: Check for existing comment
|
| 47 |
+
if: ${{ steps.check-develop-branch.outputs.reason || steps.check-main-branch.outputs.reason }}
|
| 48 |
+
id: check-comment
|
| 49 |
+
run: |
|
| 50 |
+
commentExists=$(gh pr view ${{ github.event.pull_request.number }} --json comments -q '.comments[].body' | grep -F "Invalid branch name" || echo '')
|
| 51 |
+
if [[ -n "$commentExists" ]]; then
|
| 52 |
+
echo "commentExists=true" >> $GITHUB_OUTPUT
|
| 53 |
+
else
|
| 54 |
+
echo "commentExists=false" >> $GITHUB_OUTPUT
|
| 55 |
+
fi
|
| 56 |
+
env:
|
| 57 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 58 |
+
|
| 59 |
+
- name: Comment on PR for invalid branch name
|
| 60 |
+
if: steps.check-comment.outputs.commentExists == 'false'
|
| 61 |
+
run: |
|
| 62 |
+
reason="${{ steps.check-develop-branch.outputs.reason }}${{ steps.check-main-branch.outputs.reason }}"
|
| 63 |
+
gh pr comment ${{ github.event.pull_request.number }} --body "$reason Please review our [branch naming guidelines](https://docs.openbb.co/platform/developer_guide/github#branch-naming-conventions)."
|
| 64 |
+
env:
|
| 65 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 66 |
+
|
| 67 |
+
- name: Fail if branch name is invalid
|
| 68 |
+
if: ${{ steps.check-develop-branch.outputs.reason || steps.check-main-branch.outputs.reason }}
|
| 69 |
+
run: |
|
| 70 |
+
echo "Invalid branch name. Please review our branch naming guidelines."
|
| 71 |
+
exit 1
|
.github/workflows/gh-pr-labels.yml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 🏷️ Pull Request Labels
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request:
|
| 5 |
+
types: [opened, reopened, labeled, unlabeled, synchronize]
|
| 6 |
+
|
| 7 |
+
jobs:
|
| 8 |
+
label:
|
| 9 |
+
runs-on: ubuntu-latest
|
| 10 |
+
steps:
|
| 11 |
+
# - uses: mheap/github-action-required-labels@v1
|
| 12 |
+
# with:
|
| 13 |
+
# mode: minimum
|
| 14 |
+
# count: 1
|
| 15 |
+
# labels: "guides, bug, build, docker, docs, feat XS, feat S, feat M, feat L, feat XL, help wanted, refactor, tests, dependencies, release"
|
| 16 |
+
- uses: mheap/github-action-required-labels@v1
|
| 17 |
+
with:
|
| 18 |
+
mode: exactly
|
| 19 |
+
count: 0
|
| 20 |
+
labels: "do not merge"
|
| 21 |
+
|
| 22 |
+
- name: 🏷️ Label OpenBB Platform PRs
|
| 23 |
+
uses: srvaroa/labeler@master
|
| 24 |
+
env:
|
| 25 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
.github/workflows/macos-build.yml
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: MacOS Build
|
| 2 |
+
|
| 3 |
+
env:
|
| 4 |
+
OPENBB_LOG_COLLECT: false
|
| 5 |
+
OPENBB_USE_PROMPT_TOOLKIT: false
|
| 6 |
+
OPENBB_FILE_OVERWRITE: true
|
| 7 |
+
PIP_DEFAULT_TIMEOUT: 100
|
| 8 |
+
PYTHONNOUSERSITE: 1
|
| 9 |
+
|
| 10 |
+
on: workflow_dispatch
|
| 11 |
+
|
| 12 |
+
concurrency:
|
| 13 |
+
group: ${{ github.workflow }}-${{ github.ref }}
|
| 14 |
+
cancel-in-progress: true
|
| 15 |
+
|
| 16 |
+
jobs:
|
| 17 |
+
M1-MacOs-Build:
|
| 18 |
+
name: M1 MacOS Build
|
| 19 |
+
runs-on: [self-hosted, macos, ARM64]
|
| 20 |
+
steps:
|
| 21 |
+
# Checkout repository main branch. this allows for the commit hashes to line up
|
| 22 |
+
- name: Checkout
|
| 23 |
+
uses: actions/checkout@v3
|
| 24 |
+
- name: Git Log
|
| 25 |
+
run: git log
|
| 26 |
+
# The following commands to clear previous PATHS and restore to defaults since we have to maintain the instance ourselves
|
| 27 |
+
- name: Clean Previous Path
|
| 28 |
+
run: |
|
| 29 |
+
export PATH=""
|
| 30 |
+
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
| 31 |
+
echo $PATH
|
| 32 |
+
# Set up caching for conda env so that the workflow runs quickly after the first time
|
| 33 |
+
- name: Setup Conda Caching
|
| 34 |
+
uses: actions/cache@v3
|
| 35 |
+
with:
|
| 36 |
+
path: ~/conda_pkgs_dir
|
| 37 |
+
key: conda-macos-3-10-${{ hashFiles('build/conda/environments/constructor.yml') }}
|
| 38 |
+
# Set up miniconda using the environment yaml file within the repo
|
| 39 |
+
- name: Setup Miniconda
|
| 40 |
+
uses: conda-incubator/setup-miniconda@v3.0.4
|
| 41 |
+
with:
|
| 42 |
+
miniconda-version: "latest"
|
| 43 |
+
auto-update-conda: true
|
| 44 |
+
channels: conda-forge,defaults
|
| 45 |
+
show-channel-urls: true
|
| 46 |
+
channel-priority: flexible
|
| 47 |
+
environment-file: build/conda/environments/constructor.yml
|
| 48 |
+
activate-environment: constructor
|
| 49 |
+
auto-activate-base: false
|
| 50 |
+
|
| 51 |
+
- name: Creating Application Keychain
|
| 52 |
+
env:
|
| 53 |
+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
| 54 |
+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
| 55 |
+
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
|
| 56 |
+
MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
|
| 57 |
+
run:
|
| 58 |
+
| # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
|
| 59 |
+
echo "Ensuring Keychain with same name does not exist"
|
| 60 |
+
rm -rf /Users/openbb/Library/Keychains/build.keychain-db
|
| 61 |
+
echo "Decoding certificate"
|
| 62 |
+
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
| 63 |
+
echo "Creating Keychain"
|
| 64 |
+
security create-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
|
| 65 |
+
echo "Setting Default Keychain"
|
| 66 |
+
security default-keychain -s build.keychain
|
| 67 |
+
echo "Unlocking Keychain"
|
| 68 |
+
security unlock-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
|
| 69 |
+
echo "Importing Keychain"
|
| 70 |
+
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
|
| 71 |
+
echo "Setting Partition List"
|
| 72 |
+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PWD build.keychain
|
| 73 |
+
|
| 74 |
+
- name: Create Signed Package
|
| 75 |
+
env:
|
| 76 |
+
MACOS_INSTALLER_KEYCHAIN_PWD: ${{ secrets.MACOS_INSTALLER_KEYCHAIN_PWD }}
|
| 77 |
+
MACOS_INSTALLER_SIGNING_IDENTITY_NAME: ${{ secrets.MACOS_CODESIGN_INSTALLER_IDENTITY_NAME }}
|
| 78 |
+
MACOS_APPLICATION_SIGNING_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
|
| 79 |
+
run: |
|
| 80 |
+
security unlock-keychain -p $MACOS_INSTALLER_KEYCHAIN_PWD install.keychain
|
| 81 |
+
echo "signing_identity_name: $MACOS_INSTALLER_SIGNING_IDENTITY_NAME" >> build/conda/installer/construct.yaml
|
| 82 |
+
echo "notarization_identity_name: $MACOS_APPLICATION_SIGNING_IDENTITY" >> build/conda/installer/construct.yaml
|
| 83 |
+
cd build/conda && constructor installer/. && cd ../../
|
| 84 |
+
mv build/conda/OpenBB-Platform-MacOSX-arm64.pkg OpenBB-Platform-MacOSX-arm64.pkg
|
| 85 |
+
shell: bash -l {0}
|
| 86 |
+
|
| 87 |
+
- name: Deleting Previous Keychain
|
| 88 |
+
run: |
|
| 89 |
+
echo "Deleting Previous Keychain to Clean Instance"
|
| 90 |
+
rm -rf /Users/openbb/Library/Keychains/build.keychain-db
|
| 91 |
+
|
| 92 |
+
- name: Clean up Build Artifacts
|
| 93 |
+
run: |
|
| 94 |
+
rm -rf build/conda/tmp
|
| 95 |
+
|
| 96 |
+
- name: Notarize DMG
|
| 97 |
+
env:
|
| 98 |
+
NOTARIZE_APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
|
| 99 |
+
NOTARIZE_APPLE_PWD: ${{ secrets.NOTARIZE_APPLE_PWD }}
|
| 100 |
+
NOTARIZE_APPLE_TEAM_ID: ${{ secrets.NOTARIZE_APPLE_TEAM_ID }}
|
| 101 |
+
run: |
|
| 102 |
+
xcrun notarytool submit OpenBB-Platform-MacOSX-arm64.pkg --apple-id "$NOTARIZE_APPLE_ID" --password "$NOTARIZE_APPLE_PWD" --team-id "$NOTARIZE_APPLE_TEAM_ID" --wait
|
| 103 |
+
|
| 104 |
+
- name: Staple
|
| 105 |
+
run: |
|
| 106 |
+
xcrun stapler staple OpenBB-Platform-MacOSX-arm64.pkg
|
| 107 |
+
|
| 108 |
+
- name: Save Build Artifact PKG
|
| 109 |
+
uses: actions/upload-artifact@v4
|
| 110 |
+
with:
|
| 111 |
+
name: OpenBBM1.pkg
|
| 112 |
+
path: OpenBB-Platform-MacOSX-arm64.pkg
|
| 113 |
+
|
| 114 |
+
- name: Clean up Build Artifacts
|
| 115 |
+
run: |
|
| 116 |
+
rm OpenBB-Platform-MacOSX-arm64.pkg
|
| 117 |
+
|
| 118 |
+
# Job to build the MacOS Intel version of the Terminal===================================
|
| 119 |
+
Intel-MacOs-Build:
|
| 120 |
+
name: Intel MacOS Build
|
| 121 |
+
runs-on: [self-hosted, macos, x64]
|
| 122 |
+
steps:
|
| 123 |
+
# Checkout repository main branch. this allows for the commit hashes to line up
|
| 124 |
+
- name: Checkout
|
| 125 |
+
uses: actions/checkout@v3
|
| 126 |
+
- name: Git Log
|
| 127 |
+
run: git log
|
| 128 |
+
# The following commands to clear previous PATHS and restore to defaults since we have to maintain the instance ourselves
|
| 129 |
+
- name: Clean Previous Path
|
| 130 |
+
run: |
|
| 131 |
+
export PATH=""
|
| 132 |
+
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
| 133 |
+
echo $PATH
|
| 134 |
+
# Set up caching for conda env so that the workflow runs quickly after the first time
|
| 135 |
+
- name: Setup Conda Caching
|
| 136 |
+
uses: actions/cache@v3
|
| 137 |
+
with:
|
| 138 |
+
path: ~/conda_pkgs_dir
|
| 139 |
+
key: conda-macos-3-10-${{ hashFiles('build/conda/environments/constructor.yml') }}
|
| 140 |
+
# Set up miniconda using the environment yaml file within the repo
|
| 141 |
+
- name: Setup Miniconda
|
| 142 |
+
uses: conda-incubator/setup-miniconda@v3.0.4
|
| 143 |
+
with:
|
| 144 |
+
miniconda-version: "latest"
|
| 145 |
+
auto-update-conda: true
|
| 146 |
+
channels: conda-forge,defaults
|
| 147 |
+
show-channel-urls: true
|
| 148 |
+
channel-priority: flexible
|
| 149 |
+
environment-file: build/conda/environments/constructor.yml
|
| 150 |
+
activate-environment: constructor
|
| 151 |
+
auto-activate-base: false
|
| 152 |
+
|
| 153 |
+
- name: Creating Application Keychain
|
| 154 |
+
env:
|
| 155 |
+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
| 156 |
+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
| 157 |
+
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
|
| 158 |
+
MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
|
| 159 |
+
run:
|
| 160 |
+
| # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
|
| 161 |
+
echo "Ensuring Keychain with same name does not exist"
|
| 162 |
+
rm -rf /Users/openbb/Library/Keychains/build.keychain-db
|
| 163 |
+
echo "Decoding certificate"
|
| 164 |
+
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
| 165 |
+
echo "Creating Keychain"
|
| 166 |
+
security create-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
|
| 167 |
+
echo "Setting Default Keychain"
|
| 168 |
+
security default-keychain -s build.keychain
|
| 169 |
+
echo "Unlocking Keychain"
|
| 170 |
+
security unlock-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
|
| 171 |
+
echo "Importing Keychain"
|
| 172 |
+
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
|
| 173 |
+
echo "Setting Partition List"
|
| 174 |
+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PWD build.keychain
|
| 175 |
+
|
| 176 |
+
- name: Create Signed Package
|
| 177 |
+
env:
|
| 178 |
+
MACOS_INSTALLER_KEYCHAIN_PWD: ${{ secrets.MACOS_INSTALLER_KEYCHAIN_PWD }}
|
| 179 |
+
MACOS_INSTALLER_SIGNING_IDENTITY_NAME: ${{ secrets.MACOS_CODESIGN_INSTALLER_IDENTITY_NAME }}
|
| 180 |
+
MACOS_APPLICATION_SIGNING_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
|
| 181 |
+
run: |
|
| 182 |
+
security unlock-keychain -p $MACOS_INSTALLER_KEYCHAIN_PWD install.keychain
|
| 183 |
+
echo "signing_identity_name: $MACOS_INSTALLER_SIGNING_IDENTITY_NAME" >> build/conda/installer/construct.yaml
|
| 184 |
+
echo "notarization_identity_name: $MACOS_APPLICATION_SIGNING_IDENTITY" >> build/conda/installer/construct.yaml
|
| 185 |
+
cd build/conda && constructor installer/. && cd ../../
|
| 186 |
+
mv build/conda/OpenBB-Platform-MacOSX-x86_64.pkg OpenBB-Platform-MacOSX-x86_64.pkg
|
| 187 |
+
shell: bash -l {0}
|
| 188 |
+
|
| 189 |
+
- name: Deleting Previous Keychain
|
| 190 |
+
run: |
|
| 191 |
+
echo "Deleting Previous Keychain to Clean Instance"
|
| 192 |
+
rm -rf /Users/openbb/Library/Keychains/build.keychain-db
|
| 193 |
+
|
| 194 |
+
- name: Clean up Build Artifacts
|
| 195 |
+
run: |
|
| 196 |
+
rm -rf build/conda/tmp
|
| 197 |
+
|
| 198 |
+
- name: Notarize DMG
|
| 199 |
+
env:
|
| 200 |
+
NOTARIZE_APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
|
| 201 |
+
NOTARIZE_APPLE_PWD: ${{ secrets.NOTARIZE_APPLE_PWD }}
|
| 202 |
+
NOTARIZE_APPLE_TEAM_ID: ${{ secrets.NOTARIZE_APPLE_TEAM_ID }}
|
| 203 |
+
run: |
|
| 204 |
+
xcrun notarytool submit OpenBB-Platform-MacOSX-x86_64.pkg --apple-id "$NOTARIZE_APPLE_ID" --password "$NOTARIZE_APPLE_PWD" --team-id "$NOTARIZE_APPLE_TEAM_ID" --wait
|
| 205 |
+
|
| 206 |
+
- name: Staple
|
| 207 |
+
run: |
|
| 208 |
+
xcrun stapler staple OpenBB-Platform-MacOSX-x86_64.pkg
|
| 209 |
+
|
| 210 |
+
- name: Save Build Artifact PKG
|
| 211 |
+
uses: actions/upload-artifact@v4
|
| 212 |
+
with:
|
| 213 |
+
name: OpenBBIntel.pkg
|
| 214 |
+
path: OpenBB-Platform-MacOSX-x86_64.pkg
|
| 215 |
+
|
| 216 |
+
- name: Clean up Build Artifacts
|
| 217 |
+
run: |
|
| 218 |
+
rm OpenBB-Platform-MacOSX-x86_64.pkg
|
.github/workflows/test-integration-platform.yml
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 🚉 Integration test Platform (API)
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
workflow_dispatch:
|
| 5 |
+
pull_request:
|
| 6 |
+
branches:
|
| 7 |
+
- release/*
|
| 8 |
+
|
| 9 |
+
concurrency:
|
| 10 |
+
group: ${{ github.workflow }}-${{ github.ref }}
|
| 11 |
+
cancel-in-progress: true
|
| 12 |
+
|
| 13 |
+
jobs:
|
| 14 |
+
api-integration-tests:
|
| 15 |
+
runs-on: ubuntu-latest
|
| 16 |
+
env:
|
| 17 |
+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
| 18 |
+
OPENBB_API_AUTH: true
|
| 19 |
+
OPENBB_API_USERNAME: "USER"
|
| 20 |
+
OPENBB_API_PASSWORD: "PASS"
|
| 21 |
+
|
| 22 |
+
steps:
|
| 23 |
+
- name: Slack Notification - Starting
|
| 24 |
+
uses: act10ns/slack@v1
|
| 25 |
+
with:
|
| 26 |
+
status: starting
|
| 27 |
+
channel: "#workflows"
|
| 28 |
+
message: Starting API Integration Test...
|
| 29 |
+
if: always()
|
| 30 |
+
|
| 31 |
+
- name: Checkout code
|
| 32 |
+
uses: actions/checkout@v4
|
| 33 |
+
|
| 34 |
+
- name: Checkout specific ref
|
| 35 |
+
if: github.event_name == 'pull_request'
|
| 36 |
+
run: git fetch origin ${{ github.event.pull_request.head.ref }} && git checkout FETCH_HEAD
|
| 37 |
+
|
| 38 |
+
- name: Setup Python 3.10
|
| 39 |
+
uses: actions/setup-python@v5
|
| 40 |
+
with:
|
| 41 |
+
python-version: "3.10"
|
| 42 |
+
architecture: x64
|
| 43 |
+
|
| 44 |
+
- name: Install Dependencies
|
| 45 |
+
run: |
|
| 46 |
+
python -m venv runner_env
|
| 47 |
+
source runner_env/bin/activate
|
| 48 |
+
pip install poetry toml
|
| 49 |
+
python openbb_platform/dev_install.py -e
|
| 50 |
+
|
| 51 |
+
- name: Populate System Setting Files
|
| 52 |
+
run: |
|
| 53 |
+
mkdir -p ~/.openbb_platform
|
| 54 |
+
touch ~/.openbb_platform/system_settings.json
|
| 55 |
+
echo '{"log_collect":false}' > ~/.openbb_platform/system_settings.json
|
| 56 |
+
cat ~/.openbb_platform/system_settings.json
|
| 57 |
+
|
| 58 |
+
- name: Create and Populate user_settings.json from GitHub Secrets
|
| 59 |
+
run: |
|
| 60 |
+
touch ~/.openbb_platform/user_settings.json
|
| 61 |
+
echo '{
|
| 62 |
+
"credentials": {
|
| 63 |
+
"benzinga_api_key": "${{ secrets.BENZINGA_API_KEY }}",
|
| 64 |
+
"fmp_api_key": "${{ secrets.FMP_API_KEY }}",
|
| 65 |
+
"polygon_api_key": "${{ secrets.POLYGON_API_KEY }}",
|
| 66 |
+
"alpha_vantage_api_key": "${{ secrets.ALPHA_VANTAGE_API_KEY }}",
|
| 67 |
+
"fred_api_key": "${{ secrets.FRED_API_KEY }}",
|
| 68 |
+
"intrinio_api_key": "${{ secrets.INTRINIO_API_KEY }}",
|
| 69 |
+
"tradingeconomics_api_key": "${{ secrets.TRADINGECONOMICS_API_KEY }}",
|
| 70 |
+
"quandl_api_key": "${{ secrets.QUANDL_API_KEY }}",
|
| 71 |
+
"biztoc_api_key": "${{ secrets.BIZTOC_API_KEY }}",
|
| 72 |
+
"nasdaq_api_key": "${{ secrets.NASDAQ_API_KEY }}",
|
| 73 |
+
"tiingo_token": "${{ secrets.TIINGO_TOKEN }}"
|
| 74 |
+
}
|
| 75 |
+
}' > ~/.openbb_platform/user_settings.json
|
| 76 |
+
|
| 77 |
+
- name: Build openbb
|
| 78 |
+
run: |
|
| 79 |
+
source runner_env/bin/activate
|
| 80 |
+
python -c "import openbb; openbb.build()"
|
| 81 |
+
|
| 82 |
+
- name: Launch the Uvicorn Process
|
| 83 |
+
run: |
|
| 84 |
+
source runner_env/bin/activate
|
| 85 |
+
uvicorn openbb_core.api.rest_api:app --host 0.0.0.0 --port 8000 --reload &
|
| 86 |
+
|
| 87 |
+
- name: Wait for 42 seconds
|
| 88 |
+
run: sleep 42
|
| 89 |
+
|
| 90 |
+
- name: Check installed packages
|
| 91 |
+
run: |
|
| 92 |
+
source runner_env/bin/activate
|
| 93 |
+
pip list
|
| 94 |
+
|
| 95 |
+
- name: Run Integration Tests
|
| 96 |
+
run: |
|
| 97 |
+
source runner_env/bin/activate
|
| 98 |
+
pytest openbb_platform -m integration
|
| 99 |
+
|
| 100 |
+
- name: Upload summary to Slack
|
| 101 |
+
uses: adrey/slack-file-upload-action@master
|
| 102 |
+
with:
|
| 103 |
+
token: ${{ secrets.SLACK_API_TOKEN }}
|
| 104 |
+
initial_comment: "API Integration test summary"
|
| 105 |
+
title: "Integration test summary"
|
| 106 |
+
path: summary.txt
|
| 107 |
+
channel: ${{ secrets.SLACK_CHANNEL_ID }}
|
| 108 |
+
|
| 109 |
+
- name: Slack Notification - Success/Failure
|
| 110 |
+
uses: act10ns/slack@v1
|
| 111 |
+
with:
|
| 112 |
+
status: ${{ job.status }}
|
| 113 |
+
steps: ${{ toJson(steps) }}
|
| 114 |
+
channel: "#workflows"
|
| 115 |
+
if: always()
|
.github/workflows/test-unit-cli.yml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 🖥️ Unit test CLI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request:
|
| 5 |
+
branches:
|
| 6 |
+
- develop
|
| 7 |
+
paths:
|
| 8 |
+
- 'cli/**'
|
| 9 |
+
|
| 10 |
+
concurrency:
|
| 11 |
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
| 12 |
+
cancel-in-progress: true
|
| 13 |
+
|
| 14 |
+
jobs:
|
| 15 |
+
unit_tests:
|
| 16 |
+
runs-on: ubuntu-latest
|
| 17 |
+
strategy:
|
| 18 |
+
fail-fast: false
|
| 19 |
+
|
| 20 |
+
matrix:
|
| 21 |
+
python_version:
|
| 22 |
+
["3.9", "3.10", "3.11", "3.12"]
|
| 23 |
+
steps:
|
| 24 |
+
- name: Checkout code
|
| 25 |
+
uses: actions/checkout@v4
|
| 26 |
+
with:
|
| 27 |
+
ref: ${{ github.event.pull_request.head.sha }}
|
| 28 |
+
- name: Install Python ${{ matrix.python_version }}
|
| 29 |
+
uses: actions/setup-python@v5
|
| 30 |
+
with:
|
| 31 |
+
python-version: ${{ matrix.python_version }}
|
| 32 |
+
allow-prereleases: true
|
| 33 |
+
cache: "pip"
|
| 34 |
+
|
| 35 |
+
- name: Cache pip packages
|
| 36 |
+
uses: actions/cache@v4
|
| 37 |
+
with:
|
| 38 |
+
path: ~/.cache/pip
|
| 39 |
+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('cli/poetry.lock') }}
|
| 40 |
+
restore-keys: |
|
| 41 |
+
${{ runner.os }}-pip-
|
| 42 |
+
|
| 43 |
+
- name: Run tests
|
| 44 |
+
run: |
|
| 45 |
+
pip install nox
|
| 46 |
+
nox -f .github/scripts/noxfile.py -s unit_test_cli --python ${{ matrix.python_version }}
|
.github/workflows/test-unit-platform.yml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 🚉 Unit test Platform
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request:
|
| 5 |
+
branches:
|
| 6 |
+
- develop
|
| 7 |
+
paths:
|
| 8 |
+
- 'openbb_platform/**'
|
| 9 |
+
|
| 10 |
+
concurrency:
|
| 11 |
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
| 12 |
+
cancel-in-progress: true
|
| 13 |
+
|
| 14 |
+
jobs:
|
| 15 |
+
unit_tests:
|
| 16 |
+
runs-on: ubuntu-latest
|
| 17 |
+
strategy:
|
| 18 |
+
fail-fast: false
|
| 19 |
+
|
| 20 |
+
matrix:
|
| 21 |
+
python_version:
|
| 22 |
+
["3.9", "3.10", "3.11", "3.12"]
|
| 23 |
+
steps:
|
| 24 |
+
- name: Checkout code
|
| 25 |
+
uses: actions/checkout@v4
|
| 26 |
+
with:
|
| 27 |
+
ref: ${{ github.event.pull_request.head.sha }}
|
| 28 |
+
- name: Install Python ${{ matrix.python_version }}
|
| 29 |
+
uses: actions/setup-python@v5
|
| 30 |
+
with:
|
| 31 |
+
python-version: ${{ matrix.python_version }}
|
| 32 |
+
allow-prereleases: true
|
| 33 |
+
cache: "pip"
|
| 34 |
+
|
| 35 |
+
- name: Cache pip packages
|
| 36 |
+
uses: actions/cache@v4
|
| 37 |
+
with:
|
| 38 |
+
path: ~/.cache/pip
|
| 39 |
+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('openbb_platform/poetry.lock') }}
|
| 40 |
+
restore-keys: |
|
| 41 |
+
${{ runner.os }}-pip-
|
| 42 |
+
|
| 43 |
+
- name: Run tests
|
| 44 |
+
run: |
|
| 45 |
+
pip install nox
|
| 46 |
+
nox -f .github/scripts/noxfile.py -s unit_test_platform --python ${{ matrix.python_version }}
|