Skip to content

Integrate services on Flatpak builds#4994

Merged
GeorgesStavracas merged 1 commit intoobsproject:masterfrom
GeorgesStavracas:gbsneto/flatpak-services-integration
Nov 3, 2021
Merged

Integrate services on Flatpak builds#4994
GeorgesStavracas merged 1 commit intoobsproject:masterfrom
GeorgesStavracas:gbsneto/flatpak-services-integration

Conversation

@GeorgesStavracas
Copy link
Copy Markdown
Member

@GeorgesStavracas GeorgesStavracas commented Jul 13, 2021

Description

Pass Twitch, Restream, and YouTube client ids and hashes to the Flatpak build, and enable services integration.

Motivation and Context

The flatpak-builder tool now supports passing secrets options to the build system. These options are not printed during the build, nor added to the resolved manifest after build, so they don't leak env vars from CI.

Pass the various services hashes and clientids to the build system using the new "secret-opts" key.

Related: flathub/com.obsproject.Studio#139

How Has This Been Tested?

  • Let this CI workflow run on a commit of the master branch
  • Download the Flatpak artifact and observe that services are enabled

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@GeorgesStavracas GeorgesStavracas changed the title CI: Integrate services on Flatpak builds Integrate services on Flatpak builds Jul 13, 2021
@WizardCM WizardCM added Enhancement Improvement to existing functionality Linux Affects Linux labels Jul 13, 2021
@GeorgesStavracas GeorgesStavracas marked this pull request as draft July 14, 2021 14:20
@GeorgesStavracas GeorgesStavracas changed the title Integrate services on Flatpak builds Draft: Integrate services on Flatpak builds Jul 14, 2021
@GeorgesStavracas
Copy link
Copy Markdown
Member Author

Note: maked this as a draft to investigate the following issues:

  • Flatpaks ship a /app/manifest.json file with the build manifest. This PR uses the manifest to integrate services, which would ship to everyone the client ids and hashes.
  • There might be a better way to do that using the Flatpak GitHub action instead. Needs investigation.
  • flatpak-builder probably need to be adjusted to handle this use-case

@GeorgesStavracas
Copy link
Copy Markdown
Member Author

Relevant flatpak-builder pull request: flatpak/flatpak-builder#406

@tytan652
Copy link
Copy Markdown
Collaborator

tytan652 commented Nov 3, 2021

Just an update message to tell the actual situation:

So this PR just need to be updated with the brand new secret-opts.

@GeorgesStavracas
Copy link
Copy Markdown
Member Author

GeorgesStavracas commented Nov 3, 2021

Yup, I've been trying to do that on https://github.com/GeorgesStavracas/obs-studio/tree/gbsneto/flatpak-services but I've found that the Flatpak action didn't include flatpak-builder 1.2 yet. I've been annoying Bilal about it, let's see how it goes now 🙂

@GeorgesStavracas GeorgesStavracas added the Seeking Testers Build artifacts on CI label Nov 3, 2021
@GeorgesStavracas GeorgesStavracas force-pushed the gbsneto/flatpak-services-integration branch from 8dcf53e to 1c18685 Compare November 3, 2021 13:51
@GeorgesStavracas GeorgesStavracas force-pushed the gbsneto/flatpak-services-integration branch from 1c18685 to 1fd83cc Compare November 3, 2021 14:22
The flatpak-builder tool now supports passing secrets options to the
build system. These options are not printed during the build, nor
added to the resolved manifest after build, so they don't leak env
vars from CI.

Make secret variables part of the Flatpak workflow environment, like
the main workflow. Pass the various services hashes and clientids to
the build system using the new "secret-opts" key.
@GeorgesStavracas GeorgesStavracas force-pushed the gbsneto/flatpak-services-integration branch from 1fd83cc to 393d67c Compare November 3, 2021 14:35
@GeorgesStavracas GeorgesStavracas marked this pull request as ready for review November 3, 2021 14:42
@GeorgesStavracas
Copy link
Copy Markdown
Member Author

I could confirm this is working by pushing these commits to the master branch of my fork, and adding bogus secrets that would purposefully fail the build. You can verify here that the Flatpak build also failed with:

/run/build/obs/UI/auth-twitch.cpp: In member function ‘bool TwitchAuth::MakeApiRequest(const char*, json11::Json&)’:
/run/build/obs/_flatpak_build/UI/ui-config.h:21:25: error: unable to find numeric literal operator ‘operator""xbadc0ffee’
   21 | #define TWITCH_HASH     0x***
      |                         ^~~~~~~~~~~~~

This is sufficient to verify that the secrets are properly propagated to the build system through secret-opts.

@GeorgesStavracas GeorgesStavracas changed the title Draft: Integrate services on Flatpak builds Integrate services on Flatpak builds Nov 3, 2021
@GeorgesStavracas
Copy link
Copy Markdown
Member Author

GeorgesStavracas commented Nov 3, 2021

This was LGTMed on Discord, thanks Rodney!

@GeorgesStavracas GeorgesStavracas merged commit 1392ea5 into obsproject:master Nov 3, 2021
@GeorgesStavracas GeorgesStavracas deleted the gbsneto/flatpak-services-integration branch November 3, 2021 16:17
@RytoEX RytoEX added this to the OBS Studio 27.2 milestone Nov 3, 2021
@GeorgesStavracas GeorgesStavracas mentioned this pull request Nov 24, 2021
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improvement to existing functionality Linux Affects Linux Seeking Testers Build artifacts on CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants