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

Upstream merge #11

Merged
merged 125 commits into from
Mar 29, 2024
Merged

Upstream merge #11

merged 125 commits into from
Mar 29, 2024

Conversation

wilwade
Copy link

@wilwade wilwade commented Mar 27, 2024

Merging the upstream changes

image

Bullrich and others added 30 commits June 8, 2023 13:03
Created a new page with the Westend chain.

Added a popup so you can easily change the chin.

Updated the content so it automatically assigns information based on the
chain.

Added the network data object of the westend network.

Added a new page `/westend` where the chain is automatically set based
on that information.

Added a network selection dropdown to switch between rococo and westend
Fixed errors caused when the base of the project is not `/`.

This changes get into consideration having a different base for the
occasion that it is being built in a root directory, or, like in github
pages, in a `/polkadot-testnet-faucet` directory.
Fixed missing configuration that would enable relative path when the
base is enabled.

With the previous configuration it was looking for files at
`./polkadot-testnet-faucet` (so, when you are in
`/polkadot-testnet-faucet` it will search for files in
`/polkadot-testnet-faucet/polkadot-testnet-faucet`.

This setting disables relatives path when the variable `BASE` is
enabled.
Made the "Questions" button hide in mobile. This is because too many
buttons in the UI sometimes overflow the width on the screen.
Updated the success screen to use the url from the block explorer
instead of a hardcoded one.

This commit closes paritytech#293 

Deleted residual code from before the existence of the success and
failure screens.

Also, modified margins on mobile so the FAQ section isn't that far away
and you don't need to scroll that much.
1. UI image.
The problem with that one, is that it's not being used. We deploy UI to
GitHub pages currently, and even if we potentially will switch from it,
deploying static site as a docker image is far from a good solution with
much higher operation costs and downtimes on deployment.
Also, fixes paritytech#279

2. docker-compose.yml's
These were made for the local development by DevOps, however, they
aren't fit for the local development (the don't provide watch mode,
re-building is painful, debug...), and they are actually fit for
running it locally if you aren't developing the app.
This is a step to move client/ to src/, furthermore joining what was
three different repos before.
I tried to minimize the amount of changes here, so there is still
client/.eslintrc.cjs, and still a separate package.json.
However, the lint and format commands and checks are unified.
1. Merging configs for BOT and SERVER together. As the faucet is now
only one application, the division brings more trouble than it solves
2. Network configuration data now lives in src/networkData.ts. This
allows us to add new configuration options without updating whole
deployment pipeline in three places.
3. Dropped explicit `validateConfig` invocation. Now config is validated
when module is imported during startup.
4. As I traced "dripAmount" configuration down to its usages, I've
discovered double conversions like "bigint->float->bigint", which
cancels whole idea of using bigint in order to escape rounding errors.
Reworked it to operate only on bigint, and use conversion only for
output.
5. For some reason, e2e tests didn't want to work on HTTP endpoints
anymore (probably, local environment issues). Changed it to WS as it
should've been done a long time ago.

IMPORTANT: this PR will have its counterparts in helm-charts and
cloud-infra. Do not merge unless changes there are merged first

Fixes paritytech#298
In the config file, we used both `required` and `mandatory` properties.
`mandatory` is the right one.
But instead of fixing it in this case, we're relaxing requirements for
`MATRIX_ACCESS_TOKEN` and `MATRIX_BOT_USER_ID` as it's currently
consciously unset for rococo web faucet
It's shoudln't be "UNIT", it actually has a name: "WOOK"
Reintroducing subscan links, for supported networks
These parts are in the same process now, so the data can be queried
directly
…uests

Removing http requests between bot and server
This time, actually tested locally
Seems that balance cap being 10 times drip amount is an established rule
of thumb, so aligned it for all networks
Bullrich and others added 5 commits March 20, 2024 12:57
This removes the base url, making the website work on the root of the
domain.

Also, by doing this change, and having set up the dns, this resolves
paritytech#348
It generates a JSON object inside the header following the instructions
from:
https://developers.google.com/search/docs/appearance/structured-data/faqpage

It parses the information of the markdown text to generate this json
object.

This resolves paritytech#277
We currently don't have an artifact retention period, so it defaults to
90 days.

While the artifact for the site is not too big, having one build per
push and PR can quickly accumulate the amount and make us hit our hard
limit.

By adding a limit to the retention day of 5 days we ensure that we get
rid of the old artifacts faster than waiting for two whole months.

I also updated all the actions version to latest release
# Conflicts:
#	.github/workflows/E2E.yml
#	.github/workflows/deploy-site.yml
#	Dockerfile
#	client/.env
#	client/.prettierrc
#	client/src/app.css
#	client/src/app.html
#	client/src/lib/assets/FAQ.md
#	client/src/lib/assets/circle.svg
#	client/src/lib/assets/polkadot.png
#	client/src/lib/components/Card.svelte
#	client/src/lib/components/Footer.svelte
#	client/src/lib/components/Form.svelte
#	client/src/lib/components/NetworkInput.svelte
#	client/src/lib/components/SocialTags.svelte
#	client/src/lib/components/screens/Success.svelte
#	client/src/lib/utils/networkData.ts
#	client/tests/test.ts
#	docker/docker-compose.rococo-external.yml
#	docker/docker-compose.rococo.yml
#	e2e/README.md
#	e2e/bootstrap.sh
#	src/faucet.e2e.ts
Dockerfile Outdated Show resolved Hide resolved
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aramikm Lots in here.

matrixWhitelistPatterns: parityWhitelist,
};

const frequencyRococo: NetworkData = {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the new network data for the drip

Copy link

@aramikm aramikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only looked at the code and from that perspective looks good.

  • I think it might be easier to wholesale accept all upstream changes and then we can apply our changes considering that our changes are minimal compared to what changed upstream and I think that's what you are trying to do.
  • Another major change was using postgres instead of SQLight which would require devops to consider that during deployment

return this.chains[index].name;
}
chains: [{ name: "Frequency Rococo Testnet", id: -1 }],
endpoint: faucetUrl(PUBLIC_FAUCET_URL),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this does not follow their pattern of default being used if PUBLIC_FAUCET_URL is not set, as a backup setting. but I think will work if we are setting PUBLIC_FAUCET_URL explicitly

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to be updating this again so we can have one backend support both the Rococo and Paseo testnets. I'll see what I can do at that time.

src/networkData.ts Outdated Show resolved Hide resolved
@wilwade wilwade merged commit a78e9b4 into main Mar 29, 2024
5 checks passed
@wilwade wilwade deleted the upstream-merge branch March 29, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants