Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor closing issue message and add upgrading guide for v0.12 #647

Merged
merged 4 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/close_issue/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
export STATUS_FIELD_ID=PVTSSF_lADOAYE_z84AWEIBzgOGd1k
export TARGET_COLUMN_ID=fa223107
export CORE_URL=https://github.com/membraneframework/membrane_core
export ISSUE_CLOSE_COMMENT="Issues related to $REPOSITORY are stored in [membrane_core]($CORE_URL), so we close this issue here and we encourage you to open it [there]($CORE_URL) with labels describing, which repositories relate to the issue."
export ISSUE_CLOSE_COMMENT="Issues related to $REPOSITORY are stored in [membrane_core]($CORE_URL), so we close this issue here and we encourage you to open it [there]($CORE_URL)."

gh issue edit $ISSUE_URL --add-project "Smackore" --add-label closed-by-membrane-bot
sleep 10
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.0.1
* Specify the order in which state fields will be printed in the error logs. [#614](https://github.com/membraneframework/membrane_core/pull/614)

## 1.0.0
* Introduce `:remove_link` action in pipelines and bins.
* Add children groups - a mechanism that allows refering to multiple children with a single identifier.
Expand Down
65 changes: 65 additions & 0 deletions guides/upgrading/v0.12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Upgrading to v0.12

Between v0.11 and v0.12 some breaking changes have occurred, so here comes the guide that will help you adjust your code to the new API. See the [release notes](https://github.com/membraneframework/membrane_core/releases/tag/v0.12.1) for details.

## Deps upgrade

Upgrade `membrane_core` to `v0.12.1`.

```elixir
defp deps do
[
{:membrane_core, "~> 0.12.1"},
...
]
end
```

## Implement `handle_child_pad_removed/4` callback in bins and pipelines, if it is needed

Now, if bin removes its pad (e.g. by removing an element linked to the bin's inner pad), bin's parent has to have implemented proper `handle_child_pad_removed/4` callback, to handle it. If there is no such a callback, default behaviour is to raise an error.

```elixir
@impl true
def handle_child_pad_removed(:rtp, Pad.ref(:rtp_input, _ssrc), _ctx, state) do
# ...
end
```

## Remove `:playback` action

Now, membrane pipelines enter the playing playback by default and they don't have to return a `:playback` action to do it.

```diff
- @impl true
- def handle_setup(_ctx, state) do
- {[playback: :playing], state}
- end
```
Instead of it, there is a new action introduced in `membrane_core` v0.12, `setup: :incomplete | :complete`. If you want to defer a moment when a component enters the playing playback, you can return `{:setup, :incomplete}` action from `handle_setup` callback. If you do that, a component will enter the playing playback only when you return `{:setup, :complete}` action from another callback, e.g. `handle_info`.

```diff
- @impl true
- def handle_setup(_ctx, state) do
- Process.send_after(self(), :play, 1000)
- {[], state}
- end
-
- @impl true
- def handle_info(:play, _ctx, state) do
- {[playback: :playing], state}
- end

+ @impl true
+ def handle_setup(_ctx, state) do
+ Process.send_after(self(), :play, 1000)
+ {[setup: :incomplete], state}
+ end
+
+ @impl true
+ def handle_info(:play, _ctx, state) do
+ {[setup: :complete], state}
+ end
```

`:setup` action is available not only in pipelines but in bins and elements as well.
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ defmodule Membrane.Mixfile do
"CHANGELOG.md",
"CONTRIBUTING.md",
"guides/upgrading/v0.11.md",
"guides/upgrading/v0.12.md",
"guides/upgrading/v1.0.0-rc0.md",
"guides/upgrading/v1.0.0-rc1.md",
LICENSE: [title: "License"]
Expand Down
Loading