-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into hogql-button
- Loading branch information
Showing
227 changed files
with
22,545 additions
and
2,448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,4 @@ | |
!plugin-server/.prettierrc | ||
!share/GeoLite2-City.mmdb | ||
!hogvm/python | ||
!unit.json | ||
!unit.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
name: Release hogql-parser | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- hogql_parser/** | ||
- .github/workflows/build-hogql-parser.yml | ||
pull_request: | ||
paths: | ||
- hogql_parser/** | ||
- .github/workflows/build-hogql-parser.yml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-version: | ||
name: Check version legitimacy | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
parser_any_changed: ${{ steps.changed-files-yaml.outputs.parser_any_changed }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetching all for comparison since last push (not just last commit) | ||
|
||
- name: Check if hogql_parser/ has changed | ||
id: changed-files-yaml | ||
uses: tj-actions/changed-files@v39 | ||
with: | ||
since_last_remote_commit: true | ||
files_yaml: | | ||
parser: | ||
- hogql_parser/** | ||
- name: Notify about release needed | ||
if: steps.changed-files-yaml.outputs.parser_any_changed == 'true' | ||
shell: bash | ||
run: | | ||
published=$(curl -fSsl https://pypi.org/pypi/hogql-parser/json | jq -r '.info.version') | ||
local=$(python hogql_parser/setup.py --version) | ||
# TODO: Only comment if no comment alraedy exists for $local | ||
if [[ "$published" == "$local" ]]; then | ||
MESSAGE_BODY="It looks like the code of `hogql-parser` has changed since last push, but its version stayed the same at $local. 👀\nMake sure to resolve this in `hogql_parser/setup.py` before merging!" | ||
curl -s -u posthog-bot:${{ secrets.POSTHOG_BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} -X POST -d "{ \"body\": \"$MESSAGE_BODY\" }" "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | ||
fi | ||
build-wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
needs: check-version | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 30 | ||
if: ${{ needs.check-version.outputs.parser_any_changed == 'true' }} | ||
strategy: | ||
matrix: | ||
# As of October 2023, GitHub doesn't have ARM Actions runners… and ARM emulation is insanely slow | ||
# (20x longer) on the Linux runners (while being reasonable on the macOS runners). Hence, we use | ||
# BuildJet as a provider of ARM runners - this solution saves a lot of time and consequently some money. | ||
os: [ubuntu-22.04, buildjet-2vcpu-ubuntu-2204-arm, macos-12] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- if: ${{ !endsWith(matrix.os, '-arm') }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- if: ${{ endsWith(matrix.os, '-arm') }} | ||
uses: deadsnakes/[email protected] # Unfortunately actions/setup-python@v4 just doesn't work on ARM! This does | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Build sdist | ||
if: matrix.os == 'ubuntu-22.04' # Only build the sdist once | ||
run: cd hogql_parser && python setup.py sdist | ||
|
||
- name: Install cibuildwheel | ||
run: python -m pip install cibuildwheel==2.16.* | ||
|
||
- name: Build wheels | ||
run: cd hogql_parser && python -m cibuildwheel --output-dir dist | ||
env: | ||
MACOSX_DEPLOYMENT_TARGET: '12' # A modern target allows us to use C++20 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: | | ||
hogql_parser/dist/*.whl | ||
hogql_parser/dist/*.tar.gz | ||
if-no-files-found: error | ||
|
||
publish: | ||
name: Publish on PyPI | ||
needs: build-wheels | ||
environment: pypi-hogql-parser | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Fetch wheels | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist/ | ||
|
||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Update hogql-parser in requirements | ||
shell: bash | ||
run: | | ||
local=$(python hogql_parser/setup.py --version) | ||
sed -i "s/hogql-parser==.*/hogql-parser==${local}/g" requirements.in | ||
sed -i "s/hogql-parser==.*/hogql-parser==${local}/g" requirements.txt | ||
- uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: '["requirements.in", "requirements.txt"]' | ||
message: 'Use new hogql-parser version' | ||
default_author: github_actions | ||
github_token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
describe('Early Access Management', () => { | ||
beforeEach(() => { | ||
cy.visit('/early_access_features') | ||
}) | ||
|
||
it('Early access feature new and list', () => { | ||
// load an empty early access feature page | ||
cy.get('h1').should('contain', 'Early Access Management') | ||
cy.title().should('equal', 'Early Access Management • PostHog') | ||
cy.get('h2').should('contain', 'Create your first feature') | ||
cy.get('[data-attr="product-introduction-docs-link"]').should( | ||
'contain', | ||
'Learn more about Early access features' | ||
) | ||
|
||
// go to create a new feature | ||
cy.get('[data-attr="create-feature"]').click() | ||
|
||
// New Feature Release page | ||
cy.get('h1').should('contain', 'New Feature Release') | ||
|
||
// cancel new feature | ||
cy.get('[data-attr="cancel-feature"]').click() | ||
cy.get('h1').should('contain', 'Early Access Management') | ||
|
||
// set feature name & description | ||
cy.get('[data-attr="create-feature"]').click() | ||
cy.get('[data-attr="feature-name"]').type('Test Feature') | ||
cy.get('[data-attr="save-feature').should('contain.text', 'Save as draft') | ||
|
||
// save | ||
cy.get('[data-attr="save-feature"]').click() | ||
cy.get('[data-attr=success-toast]').contains('Early Access Feature saved').should('exist') | ||
|
||
// back to features | ||
cy.visit('/early_access_features') | ||
cy.get('tbody').contains('Test Feature') | ||
cy.get('h2').should('not.have.text', 'Create your first feature') | ||
|
||
// edit feature | ||
cy.get('a.Link').contains('.row-name', 'Test Feature').click() | ||
cy.get('[data-attr="edit-feature"]').click() | ||
cy.get('h1').should('contain', 'Test Feature') | ||
cy.get('[data-attr="save-feature"]').should('contain.text', 'Save') | ||
|
||
// delete feature | ||
cy.get('[data-attr="save-feature"]').click() | ||
cy.get('[data-attr="delete-feature"]').click() | ||
cy.get('h3').should('contain', 'Permanently delete feature?') | ||
cy.get('[data-attr="confirm-delete-feature"]').click() | ||
cy.get('[data-attr=info-toast]') | ||
.contains('Early access feature deleted. Remember to delete corresponding feature flag if necessary') | ||
.should('exist') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.