Skip to content

feat!: change switch syntax to => - #1581

Merged
aljazerzen merged 3 commits into
mainfrom
from-text
Jan 19, 2023
Merged

aljazerzen merged 3 commits into
mainfrom
from-text

Conversation

@aljazerzen

@aljazerzen aljazerzen commented Jan 19, 2023 •

Copy link
Copy Markdown
Member

Ref #1286

@aljazerzen
aljazerzen enabled auto-merge (squash) January 19, 2023 11:47
@aljazerzen
aljazerzen merged commit 8a85eb1 into main Jan 19, 2023
@aljazerzen
aljazerzen deleted the from-text branch January 19, 2023 12:03
@snth

snth commented Jan 19, 2023

Copy link
Copy Markdown
Member

Great!

@snth

snth commented Jan 19, 2023

Copy link
Copy Markdown
Member

We'll need to release soon then though because the switch examples with -> already don't work in the playground anymore.

Comment thread CHANGELOG.md
@@ -1,5 +1,12 @@
# PRQL Changelog

## 0.5.0 — [unreleased]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't be left for 0.5.0 and has to be included in 0.4.2 because currently the playground doesn't match otherwise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. But it's a breaking change, it cannot go into 0.4.2.

I think we need to freeze the playground & docs to the latest release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree with you on both points.

How would 0.4.2 work though because it's already merged onto main so wouldn't it be included in 0.4.2 anyway?

How much work do you think it would be to maintain release branches and have those rebased automatically with each merged PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many projects do this: it's called backporting.

You have the main/master branch with all new commits.

For each release (i.e. 0.4.0) you create a branch and to release 0.4.1 you cherry-pick commits that are not breaking changes. Sometimes it's easy, but if you get merge conflicts, it's easiest to abort and release the commit only in the next major release (0.5.0).

Let's say you have this commit chain, where B is 0.4.0 release and D is a breaking change:

     0.4.0                         
A ---> B ---> C ---> D! ---> E ----> F

To release you can cherry-pick C, E & F to 0.4.0-backports branch. Let's assume that E somehow depended on D (which was not picked) and is causing a merge conflict. We just skip it and pick just C, F

     0.4.0                        0.5.0
A ---> B ---> C ---> D! ---> E ---> F
       \
        \           0.4.1
          ---> C ---> F

But this all includes more work than just releasing often.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is viable.

I also think we can just do 0.5.0 next if we have a breaking change, rather than 0.4.2?

@max-sixty

Copy link
Copy Markdown
Member

I think we should discuss, I don't see the logic of this yet.

Not nixing it, and I've often be voted down, but let's have the discussion...

@aljazerzen

Copy link
Copy Markdown
Member Author

@max-sixty do you mean switch syntax or backporting?

@snth

snth commented Jan 19, 2023

Copy link
Copy Markdown
Member

I had the same question.

RE: switch syntax I think we should revert the change for now because it's broken things in the playground.

@aljazerzen

Copy link
Copy Markdown
Member Author

it's broken things in the playground

What's broken?

max-sixty added a commit that referenced this pull request Jan 19, 2023
@max-sixty

Copy link
Copy Markdown
Member

@max-sixty do you mean switch syntax or backporting?

The switch syntax...

max-sixty added a commit that referenced this pull request Jan 19, 2023
Revert "feat!: change switch syntax to => (#1581)"

This reverts commit 8a85eb1.
@snth

snth commented Jan 19, 2023

Copy link
Copy Markdown
Member

What's broken?

It's broken in the sense that the playground doesn't match the docs or at least doesn't match the 0.4.x released code in the wild.

I went to the playground to test the code examples in #1564 and it didn't work because the playground no longer accepted the -> syntax, only the => syntax. From a UX perspective I think that's broken as richb also pointed out in #1582 .

aljazerzen added a commit that referenced this pull request Jan 23, 2023
* feat!: change switch syntax to =>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
aljazerzen pushed a commit that referenced this pull request Jan 23, 2023
Revert "feat!: change switch syntax to => (#1581)"

This reverts commit 8a85eb1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants