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

Disable element enterprise jobs in forks CI #3412

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion .github/workflows/build_enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Build Enterprise APKs
runs-on: ubuntu-latest
# Skip in forks
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
strategy:
matrix:
variant: [debug, release, nightly]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ jobs:
runs-on: ubuntu-latest
name: Danger main check
# Skip in forks, it doesn't work even with the fallback token
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
steps:
- uses: actions/checkout@v4
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
run: git submodule update --init --recursive
- run: |
npm install --save-dev @babel/plugin-transform-flow-strip-types
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
generate-github-pages:
runs-on: ubuntu-latest
# Skip in forks
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
steps:
- name: ⏬ Checkout with LFS
uses: nschloe/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
update-gradle-wrapper:
runs-on: ubuntu-latest
# Skip in forks
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
if: ${{ github.repository == 'element-hq/element-x-android' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
nightly:
name: Build and publish nightly bundle to Firebase
runs-on: ubuntu-latest
if: ${{ github.repository == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
steps:
- uses: actions/checkout@v4
- name: Use JDK 21
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightlyReports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
nightlyReports:
name: Create kover report artifact and upload sonar result.
runs-on: ubuntu-latest
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
steps:
- name: ⏬ Checkout with LFS
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly_enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
nightly:
name: Build and publish Enterprise nightly bundle to Firebase
runs-on: ubuntu-latest
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
steps:
- uses: actions/checkout@v4
Expand Down
39 changes: 26 additions & 13 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ jobs:
- uses: actions/checkout@v4
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
run: git submodule update --init --recursive
- name: Run code quality check suite
run: ./tools/check/check_code_quality.sh
Expand Down Expand Up @@ -78,11 +80,13 @@ jobs:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
run: git submodule update --init --recursive
- name: Use JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -118,11 +122,13 @@ jobs:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
run: git submodule update --init --recursive
- name: Use JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -162,11 +168,13 @@ jobs:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
run: git submodule update --init --recursive
- name: Use JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -202,11 +210,13 @@ jobs:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
run: git submodule update --init --recursive
- name: Use JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -242,11 +252,13 @@ jobs:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
run: git submodule update --init --recursive
- name: Use JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -277,7 +289,8 @@ jobs:
name: Project Check Suite
runs-on: ubuntu-latest
needs: [konsist, lint, ktlint, detekt]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ jobs:
enterprise:
name: Create App Bundle Enterprise
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
concurrency:
group: ${{ format('build-release-main-enterprise-{0}', github.sha) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-localazy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
sync-localazy:
runs-on: ubuntu-latest
# Skip in forks
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
steps:
- uses: actions/checkout@v4
- name: Use JDK 21
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-sas-strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
sync-sas-strings:
runs-on: ubuntu-latest
# Skip in forks
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ jobs:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Add SSH private keys for submodule repositories
uses: webfactory/[email protected]
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
with:
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
- name: Clone submodules
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
run: git submodule update --init --recursive
- name: ☕️ Use JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -83,6 +85,8 @@ jobs:
# https://github.com/codecov/codecov-action
- name: ☂️ Upload coverage reports to codecov
uses: codecov/codecov-action@v4
# Skip in forks
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }}
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
Binary file not shown.
27 changes: 27 additions & 0 deletions app/src/gplay/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<!-- Do not allow clearText traffic -->
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<!-- Do not allow system and user certificates by default -->

<!-- Allow only Tchap intermediate certificate authority -->
<certificates src="@raw/certignaservicesrootca" />
</trust-anchors>
</base-config>

<!-- Allow system certificates for firebase if used. No effect on FDroid variant -->
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="false">firebaseinstallations.googleapis.com</domain>
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</domain-config>

<debug-overrides>
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import io.element.android.libraries.usersearch.api.UserSearchResult

@Composable
fun SearchMultipleUsersResultItem(
isDebugBuild: Boolean,
searchResult: UserSearchResult,
isUserSelected: Boolean,
onCheckedChange: (Boolean) -> Unit,
Expand All @@ -41,6 +42,7 @@ fun SearchMultipleUsersResultItem(
)
}
CheckableUserRow(
isDebugBuild = isDebugBuild,
checked = isUserSelected,
modifier = modifier,
data = data,
Expand All @@ -53,6 +55,7 @@ fun SearchMultipleUsersResultItem(
internal fun SearchMultipleUsersResultItemPreview() = ElementThemedPreview {
Column {
SearchMultipleUsersResultItem(
isDebugBuild = false,
searchResult = UserSearchResult(
aMatrixUser(),
isUnresolved = false
Expand All @@ -62,6 +65,7 @@ internal fun SearchMultipleUsersResultItemPreview() = ElementThemedPreview {
)
HorizontalDivider()
SearchMultipleUsersResultItem(
isDebugBuild = false,
searchResult = UserSearchResult(
aMatrixUser(),
isUnresolved = false
Expand All @@ -71,6 +75,7 @@ internal fun SearchMultipleUsersResultItemPreview() = ElementThemedPreview {
)
HorizontalDivider()
SearchMultipleUsersResultItem(
isDebugBuild = false,
searchResult = UserSearchResult(
aMatrixUser(),
isUnresolved = true
Expand All @@ -80,6 +85,7 @@ internal fun SearchMultipleUsersResultItemPreview() = ElementThemedPreview {
)
HorizontalDivider()
SearchMultipleUsersResultItem(
isDebugBuild = false,
searchResult = UserSearchResult(
aMatrixUser(),
isUnresolved = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import io.element.android.libraries.usersearch.api.UserSearchResult

@Composable
fun SearchSingleUserResultItem(
isDebugBuild: Boolean,
searchResult: UserSearchResult,
onClick: () -> Unit,
modifier: Modifier = Modifier,
Expand All @@ -35,6 +36,7 @@ fun SearchSingleUserResultItem(
)
} else {
MatrixUserRow(
isDebugBuild = isDebugBuild,
modifier = modifier.clickable(onClick = onClick),
matrixUser = searchResult.matrixUser,
avatarSize = AvatarSize.UserListItem,
Expand All @@ -47,11 +49,13 @@ fun SearchSingleUserResultItem(
internal fun SearchSingleUserResultItemPreview() = ElementThemedPreview {
Column {
SearchSingleUserResultItem(
isDebugBuild = false,
searchResult = UserSearchResult(aMatrixUser(), isUnresolved = false),
onClick = {},
)
HorizontalDivider()
SearchSingleUserResultItem(
isDebugBuild = false,
searchResult = UserSearchResult(aMatrixUser(), isUnresolved = true),
onClick = {},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import kotlinx.collections.immutable.ImmutableList
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SearchUserBar(
isDebugBuild: Boolean,
query: String,
state: SearchBarResultState<ImmutableList<UserSearchResult>>,
showLoader: Boolean,
Expand Down Expand Up @@ -103,6 +104,7 @@ fun SearchUserBar(
if (isMultiSelectionEnable) {
itemsIndexed(users) { index, searchResult ->
SearchMultipleUsersResultItem(
isDebugBuild = isDebugBuild,
modifier = Modifier.fillMaxWidth(),
searchResult = searchResult,
isUserSelected = selectedUsers.contains(searchResult.matrixUser),
Expand All @@ -121,6 +123,7 @@ fun SearchUserBar(
} else {
itemsIndexed(users) { index, searchResult ->
SearchSingleUserResultItem(
isDebugBuild = isDebugBuild,
modifier = Modifier.fillMaxWidth(),
searchResult = searchResult,
onClick = { onUserSelect(searchResult.matrixUser) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fun UserListView(
modifier = modifier,
) {
SearchUserBar(
isDebugBuild = state.isDebugBuild,
modifier = Modifier.fillMaxWidth(),
query = state.searchQuery,
state = state.searchResults,
Expand Down Expand Up @@ -89,6 +90,7 @@ fun UserListView(
recentDirectRoom.matrixUser.userId == it.userId
}
CheckableUserRow(
isDebugBuild = state.isDebugBuild,
checked = isSelected,
onCheckedChange = {
if (isSelected) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class CreateRoomRootPresenter @Inject constructor(
}

return CreateRoomRootState(
isDebugBuild = buildMeta.isDebuggable,
applicationName = buildMeta.applicationName,
userListState = userListState,
startDmAction = startDmActionState.value,
Expand Down
Loading
Loading