Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into lw-6632-profile-pic…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
renanvalentin committed Jun 5, 2023
2 parents aadda4a + c1e9e01 commit 0544ccc
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 27 deletions.
16 changes: 8 additions & 8 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -1,13 +1,13 @@
# Root Level
* @input-output-hk/lace-admins @input-output-hk/lace-tech-leads
* @input-output-hk/lace-tech-leads

# Packages Teams
/packages/ui @input-output-hk/lace-ui
/packages/staking @input-output-hk/lace-staking
/packages/cardano @input-output-hk/lace-core
/packages/common @input-output-hk/lace-core
/packages/core @input-output-hk/lace-core
/packages/e2e-test @input-output-hk/lace-test-engineers
/packages/ui/ @input-output-hk/lace-ui
/packages/staking/ @input-output-hk/lace-staking
/packages/cardano/ @input-output-hk/lace-core
/packages/common/ @input-output-hk/lace-core
/packages/core/ @input-output-hk/lace-core
/packages/e2e-tests/ @input-output-hk/lace-test-engineers

# Apps
/apps @input-output-hk/lace-core
/apps/ @input-output-hk/lace-core
99 changes: 97 additions & 2 deletions .github/settings.yml
@@ -1,3 +1,5 @@
# These settings are synced to GitHub by https://probot.github.io/apps/settings/

repository:
allow_merge_commit: true
allow_rebase_merge: false
Expand All @@ -9,5 +11,98 @@ repository:
has_projects: false
has_wiki: false
name: lace
private: true
topics: lace
description: The Lace Wallet.
homepage: https://lace.io
private: false
topics: lace, cardano, wallet, crypto
enable_automated_security_fixes: true
enable_vulnerability_alerts: true

# Labels: define labels for Issues and Pull Requests
labels:
- name: browser
description: Changes to the browser application.

- name: staking
description: Changes to the staking package.

- name: e2e
description: Changes to the e2e testing instrumentation.

- name: documentation
description: Documentation related issues or pull requests.


# See https://docs.github.com/en/rest/reference/teams#add-or-update-team-repository-permissions for available options
teams:
# The permission to grant the team. Can be one of:
# * `pull` - can pull, but not push to or administer this repository.
# * `push` - can pull and push, but not administer this repository.
# * `admin` - can pull, push and administer this repository.
# * `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.
# * `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access.
- name: lace
permission: push # on open source -> triage
- name: lace-admins
permission: admin
- name: lace-tech-leads
permission: admin


branches:
- name: main
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
required_pull_request_reviews:
# The number of approvals required. (1-6)
required_approving_review_count: 1
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
# Whether the most recent push must be approved by someone other than the person who pushed it.
require_last_push_approval: true
# Blocks merge until code owners have reviewed.
require_code_owner_reviews: true
# Allow specific users, teams, or apps to bypass pull request requirements.
bypass_pull_request_allowances:
apps: []
users: []
teams: []
# Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories.
dismissal_restrictions:
apps: []
users: []
teams: []
# Required. Require status checks to pass before merging. Set to null to disable
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: true
# Required. The list of status checks to require in order to merge into this branch
checks:
- context: Build & Test
- context: block-fixup
- context: Build Staking Center
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins: true
# Prevent merge commits from being pushed to matching branches
required_linear_history: false
# Permits force pushes to the protected branch by anyone with write access to the repository.
allow_force_pushes: false
# Allows deletion of the protected branch by anyone with write access to the repository.
allow_deletions: false
# If set to true, the restrictions branch protection settings which limits who can push will also block pushes which create new branches, unless the push is initiated by a user, team, or app which has the ability to push.
block_creations: true
# Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule.
required_conversation_resolution: false
# Whether to set the branch as read-only.
lock_branch: false
# Whether users can pull changes from upstream when the branch is locked.
allow_fork_syncing: false
# Whether commits must be signed on this branch.
required_signatures: true
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
restrictions:
apps: []
users: []
teams: []
2 changes: 1 addition & 1 deletion .markdownlint.json
@@ -1,5 +1,5 @@
{
"MD013": {
"line_length": 120
"line_length": 160
}
}
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,13 @@
# Contributing

1. Please open an [issue](https://github.com/input-output-hk/lace/issues) that would clearly define the problem, or bug you are trying to solve.
(please use the appropriate template for each). Once complete please open pull request as a proposed solution to it.
2. Ensure that your source branch is up-to-date with the `main` branch, could be built and tested locally.
Update proper configuration files with details of changes to the interface, such as added environment variables, changed API endpoints, etc.
3. When opening pull requests please be aware that the CI process runs checks on linting, unit tests, and end-to-end smoke tests.
If your pull request fails these, we kindly ask that you update the tests pertaining to your pull request in the branch.
4. Please follow the coding conventions that are mostly enforced by either the root-level TS or lint configs.
Avoid disabling such rules or provide a strong reason behind that.
5. Please keep in mind that it might take some time until your pull request gets properly reviewed, and be open for further discussions.

Please see [README.md](https://github.com/input-output-hk/lace#readme) for more info.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -177,7 +177,6 @@
},
"resolutions": {
"http-cache-semantics": "^4.1.1",
"minimatch": "^3.0.5",
"minimist": "^1.2.6",
"json-schema": "^0.4.0",
"follow-redirects": "^1.14.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/decrypt_secret.sh
Expand Up @@ -6,7 +6,7 @@ DECRYPTED_FILE="$FILE_LOCATION/walletConfiguration.ts"

if [ -z "${WALLET_1_PASSWORD}" ]; then
echo "WALLET_1_PASSWORD environment variable is not set, aborting"
exit
exit 1
fi

# Decrypt the file
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/encrypt_secret.sh
Expand Up @@ -5,7 +5,7 @@ DECRYPTED_FILE="$FILE_LOCATION/walletConfiguration.ts"

if [ -z "${WALLET_1_PASSWORD}" ]; then
echo "WALLET_1_PASSWORD environment variable is not set, aborting"
exit
exit 1
fi

gpg --symmetric --cipher-algo AES256 --batch --passphrase "$WALLET_1_PASSWORD" $DECRYPTED_FILE
Binary file modified packages/e2e-tests/src/support/walletConfiguration.ts.gpg
Binary file not shown.
38 changes: 26 additions & 12 deletions packages/e2e-tests/src/utils/networkManager.ts
Expand Up @@ -101,19 +101,10 @@ export class NetworkManager {
await client.send(this.NETWORK_ENABLE);
client.on('Network.responseReceived', async (request) => {
if (request.response.status >= 400) {
const requestId = request.requestId;
let requestPayload = '';
const requestPayload = await this.getRequestPostData(client, request.requestId);
const responseBody = await this.getResponseBody(client, request.requestId);
const approximateTimestamp = new Date().toString();
try {
requestPayload = JSON.stringify(await client.send('Network.getRequestPostData', { requestId }));
} catch (error) {
Logger.warn(`${error}`);
}
const responseBody = await client.send('Network.getResponseBody', { requestId });
const body = responseBody.base64Encoded
? Buffer.from(responseBody.body, 'base64').toString('ascii')
: responseBody.body;
const combinedFailedRequestInfo = `URL:\n${request.response.url}\n\nRESPONSE CODE:\n${request.response.status}\n\nAPPROXIMATE TIME:\n${approximateTimestamp}\n\nRESPONSE BODY:\n${body}\n\nREQUEST PAYLOAD:\n${requestPayload}`;
const combinedFailedRequestInfo = `URL:\n${request.response.url}\n\nRESPONSE CODE:\n${request.response.status}\n\nAPPROXIMATE TIME:\n${approximateTimestamp}\n\nRESPONSE BODY:\n${responseBody}\n\nREQUEST PAYLOAD:\n${requestPayload}`;
allure.addAttachment('Failed request', combinedFailedRequestInfo, 'text/plain');
console.log('Failed request');
console.log(combinedFailedRequestInfo);
Expand All @@ -129,6 +120,29 @@ export class NetworkManager {
});
NetworkManager.cdpSessions = [];
};

private getRequestPostData = async (client: any, requestId: any): Promise<string> => {
let postData = '';
try {
postData = JSON.stringify(await client.send('Network.getRequestPostData', { requestId }));
} catch (error) {
Logger.warn(`${error}`);
}
return postData;
};

private getResponseBody = async (client: any, requestId: any): Promise<string> => {
let responseBody = '';
try {
const getResponseBody = await client.send('Network.getResponseBody', { requestId });
responseBody = getResponseBody.base64Encoded
? Buffer.from(getResponseBody.body, 'base64').toString('ascii')
: getResponseBody.body;
} catch (error) {
Logger.warn(`${error}`);
}
return responseBody;
};
}

export default new NetworkManager();
44 changes: 43 additions & 1 deletion yarn.lock
Expand Up @@ -12864,6 +12864,13 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"

brace-expansion@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
dependencies:
balanced-match "^1.0.0"

braces@^2.3.1, braces@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729"
Expand Down Expand Up @@ -24179,13 +24186,48 @@ minimalistic-crypto-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=

minimatch@3.1.2, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2, minimatch@^5.0.1, minimatch@^5.1.0, minimatch@^6.1.0, minimatch@^6.1.4, minimatch@^6.1.6, minimatch@^6.2.0, minimatch@^8.0.2, minimatch@^9.0.0, minimatch@~3.0.2, minimatch@~3.0.5:
minimatch@3.1.2, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"

minimatch@^5.0.1, minimatch@^5.1.0:
version "5.1.6"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96"
integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==
dependencies:
brace-expansion "^2.0.1"

minimatch@^6.1.0, minimatch@^6.1.4, minimatch@^6.1.6, minimatch@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-6.2.0.tgz#2b70fd13294178c69c04dfc05aebdb97a4e79e42"
integrity sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==
dependencies:
brace-expansion "^2.0.1"

minimatch@^8.0.2:
version "8.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-8.0.4.tgz#847c1b25c014d4e9a7f68aaf63dedd668a626229"
integrity sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==
dependencies:
brace-expansion "^2.0.1"

minimatch@^9.0.0:
version "9.0.1"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.1.tgz#8a555f541cf976c622daf078bb28f29fb927c253"
integrity sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==
dependencies:
brace-expansion "^2.0.1"

minimatch@~3.0.2, minimatch@~3.0.5:
version "3.0.8"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1"
integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==
dependencies:
brace-expansion "^1.1.7"

minimist-options@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619"
Expand Down

0 comments on commit 0544ccc

Please sign in to comment.