Skip to content

Commit

Permalink
Merge branch 'feature/ABW-3971-select-factors' into feature/ABW-3974-…
Browse files Browse the repository at this point in the history
…regular-access
  • Loading branch information
sergiupuhalschi-rdx committed Dec 20, 2024
2 parents 252f2e3 + 3e86ec1 commit 87be685
Show file tree
Hide file tree
Showing 14 changed files with 1,834 additions and 28 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/phylum-daily-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Daily Analysis Phylum

on:
schedule:
# Runs at 13:00 UTC every day
- cron: '0 13 * * *'

env:
PHYLUM_PROJECT_ID: 7d09edfc-1ff4-4f88-9389-5da831913983
PHYLUM_GROUP_NAME: Wallet
PHYLUM_NAME: babylon-wallet-android
jobs:
analyze_branch_phylum:
name: Analyze dependencies with Phylum
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
strategy:
matrix:
branch: [main]
include:
- branch: main
fail-fast: false
steps:
- uses: RDXWorks-actions/checkout@main
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
- uses: RDXWorks-actions/setup-python@main
with:
python-version: 3.10.6
- name: Install Phylum
run: |
curl https://sh.phylum.io/ | sh -s -- --yes
# Add the Python user base binary directory to PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run Phylum Analysis
env:
PHYLUM_API_KEY: ${{ secrets.PHYLUM_API_KEY }}
run: |
phylum analyze --quiet --label ${{ matrix.branch }}_branch_daily_schedule > /dev/null 2>&1 || exit_code=$?
if [ $exit_code -eq 100 ]; then
echo "Phylum Analysis returned exit code 100, but continuing.";
echo "phylum_analyze_status=failure" >> $GITHUB_ENV
exit 0;
else
echo "phylum_analyze_status=success" >> $GITHUB_ENV
exit $?;
fi
- name: Analysis Status Failure notification
if: always()
uses: RDXWorks-actions/notify-slack-action@master
with:
status: ${{ env.phylum_analyze_status }}
notify_when: 'failure'
notification_title: ':clock3: Phylum Scheduled Daily Analysis:'
message_format: 'Automatic phylum analysis has found vulnerabilities on ${{ env.PHYLUM_NAME }} in ${{ matrix.branch }} branch:boom:'
footer: "Linked Repository <{repo_url}|{repo}> | <https://app.phylum.io/projects/${{ env.PHYLUM_PROJECT_ID }}?label=${{ matrix.branch }}_branch_daily_schedule&group=${{ env.PHYLUM_GROUP_NAME }}|View Report> "
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PHYLUM_WALLET_TEAM_WEBHOOK }}
18 changes: 18 additions & 0 deletions .github/workflows/pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ jobs:
- name: Cancel Previous Runs
uses: RDXWorks-actions/cancel-workflow-action@main

phylum-analyze:
if: ${{ github.event.pull_request }}
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/phylum-analyze.yml@main
permissions:
id-token: write
pull-requests: write
contents: read
deployments: write
secrets:
phylum_api_key: ${{ secrets.PHYLUM_API_KEY }}
with:
phylum_pr_number: ${{ github.event.number }}
phylum_pr_name: ${{ github.head_ref }}
phylum_group_name: Wallet
phylum_project_id: 7d09edfc-1ff4-4f88-9389-5da831913983
github_repository: ${{ github.repository }}
add_report_comment_to_pull_request: true

snyk_scan_deps_licences:
name: "Snyk deps/licenses"
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions .phylum_project
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id: 7d09edfc-1ff4-4f88-9389-5da831913983
name: babylon-wallet-android
created_at: 2024-06-03T13:06:05.511629+02:00
group_name: Wallet
depfiles:
- path: ./dependencies.lock
type: gradle
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is the config for using `pre-commit` on this repository.
#
# See https://pre-commit.com for more information
---
default_install_hook_types: [pre-push]
default_stages: [pre-push]
repos:
- repo: https://github.com/phylum-dev/phylum-ci
rev: 6df8dcf41d482787490dfe9dc69cb753bcf16a99 # frozen: v0.49.0
hooks:
- id: phylum
stages: [pre-push]
# Optional: Specify the dependency file pattern for your repository
files: |
(?x)^(
./dependencies.lock
)$
# Optional: Specify additional arguments to be passed to `phylum-ci`
args:
- -vv
- --depfile=dependencies.lock
- --audit
- --force-analysis
- --all-deps
verbose: true
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ private fun GlossaryItem.resolveTextFromGlossaryItem() = when (this) {
GlossaryItem.gateways -> stringResource(R.string.infoLink_glossary_gateways)
GlossaryItem.preauthorizations -> stringResource(id = R.string.infoLink_glossary_preauthorizations)
GlossaryItem.possibledappcalls -> stringResource(id = R.string.infoLink_glossary_possibledappcalls)
GlossaryItem.securityshields -> "" // TODO crowdin
GlossaryItem.buildingshield -> "" // TODO crowdin
GlossaryItem.securityshields -> stringResource(id = R.string.infoLink_glossary_securityshields)
GlossaryItem.buildingshield -> stringResource(id = R.string.infoLink_glossary_buildingshield)
GlossaryItem.nohardwaredevice -> "" // TODO crowdin
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ private fun SecurityShieldOnboardingContent(
) {
when (currentPage) {
SecurityShieldOnboardingViewModel.State.Page.Introduction -> InfoButton(
text = stringResource(id = R.string.infoLink_title_securityshield),
text = stringResource(id = R.string.infoLink_title_securityshields),
onClick = { onInfoClick(GlossaryItem.securityshields) }
)
SecurityShieldOnboardingViewModel.State.Page.AddFactors -> InfoButton(
text = stringResource(id = R.string.infoLink_title_buildsecurityshields),
text = stringResource(id = R.string.infoLink_title_buildingshield),
onClick = { onInfoClick(GlossaryItem.buildingshield) }
)
SecurityShieldOnboardingViewModel.State.Page.ApplyShield -> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private fun PrepareFactorsContent(

InfoButton(
modifier = Modifier.padding(horizontal = RadixTheme.dimensions.paddingXXXXLarge),
text = stringResource(id = R.string.infoLink_title_buildsecurityshields),
text = stringResource(id = R.string.infoLink_title_buildingshield),
onClick = { onInfoClick(GlossaryItem.nohardwaredevice) }
)
}
Expand Down
Loading

0 comments on commit 87be685

Please sign in to comment.