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

chore: bump @intersect.mbo/[email protected] #1441

Merged
merged 64 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
11a8d87
Test-infra: Expose storybook deployment publicly
mesudip Jun 19, 2024
2611b68
Test-infra: Add USERSNAP_SPACE_API_KEY build-arg
mesudip Jun 19, 2024
a2f1f09
Merge pull request #1356 from IntersectMBO/fix/storybook-deployment
NabinKawan Jun 20, 2024
8a91ce2
Merge pull request #1359 from IntersectMBO/infra/test-chores
mesudip Jun 20, 2024
c235dd9
chore: Update proposal-id for frontend validation in sorting
NabinKawan Jun 20, 2024
b18c87d
Fix CSP issue blocking Sentry requests in Traefik configuration
placek Jun 20, 2024
bfa66c6
Merge pull request #1362 from IntersectMBO/bug/1218-resolve-csp-issue…
placek Jun 20, 2024
248c6b8
Merge pull request #1360 from IntersectMBO/bugfix/test-4C_2
NabinKawan Jun 21, 2024
179d4e7
chore: Update matadata-anchor incorrect test ids
kneerose Jun 20, 2024
a792eb4
fix: Metadata error modal
kneerose Jun 20, 2024
340554a
chore: Add email and bio data on update dRep test
kneerose Jun 20, 2024
3b73afe
chore: Change navigation of dRep details page
kneerose Jun 21, 2024
97e8f28
chore: Add "add link" button click event on edit dRep
kneerose Jun 21, 2024
f1297b8
chore: Add missing testids on dRepDirectory page
kneerose Jun 20, 2024
4f4dbf0
chore: Add missing testids on dRep Registration page
kneerose Jun 20, 2024
e6940d4
chore: Add missing test ids on GA page
kneerose Jun 20, 2024
8ff03fa
Merge pull request #1395 from IntersectMBO/fix/metadata-validation
NabinKawan Jun 21, 2024
c76b129
Merge pull request #1394 from IntersectMBO/fix/dRep-GA-missing-test-ids
NabinKawan Jun 21, 2024
0b29322
Merge pull request #1396 from IntersectMBO/bugfix/test-2N-3M
NabinKawan Jun 21, 2024
dfd6094
fix edit drep form
Sworzen1 Jun 21, 2024
013e0ab
fix Modal ref error
Sworzen1 Jun 19, 2024
3e74a2d
fix tab index Modal
Sworzen1 Jun 19, 2024
2181a36
fix nested p error
Sworzen1 Jun 19, 2024
781914d
fix cannot get value from undefined and improve sanchonet info modal
Sworzen1 Jun 19, 2024
f185f8b
fix navigation
Sworzen1 Jun 19, 2024
46c2d1d
fix: Dashboard and homepage learn more navigation link
kneerose Jun 17, 2024
2c96724
fix: Abstain and signal-no-confidence info navigation url
kneerose Jun 17, 2024
bd439fa
chore: Replace hardcoded docs url with constant
kneerose Jun 21, 2024
f4e24da
Merge pull request #1337 from IntersectMBO/fix/console-errors
Sworzen1 Jun 21, 2024
4852a48
Merge pull request #1392 from IntersectMBO/refactor/test-docs-url-link
NabinKawan Jun 21, 2024
be00b50
chore: fix flaky tests
MSzalowski Jun 20, 2024
5dc08a4
Merge pull request #1373 from IntersectMBO/chore/1334-fix-sonarqube-a…
MSzalowski Jun 21, 2024
dbb00ed
feat: pass govtool metadata validator to pdf pillar
MSzalowski Jun 20, 2024
b90e1d4
Merge pull request #1374 from IntersectMBO/feat/pass-govtool-metadata…
MSzalowski Jun 21, 2024
0052547
fix vote
Sworzen1 Jun 21, 2024
b48108d
Merge pull request #1402 from IntersectMBO/fix/vote
Sworzen1 Jun 21, 2024
f5507e8
chore: provide tags to sentry events
MSzalowski Jun 21, 2024
17d782e
Merge pull request #1399 from IntersectMBO/chore/1326-group-the-same-…
MSzalowski Jun 21, 2024
fb643d0
[#1093] return 0 drep voting power instead of throwing 500
jankun4 Jun 23, 2024
9c729bc
[#1148] add -threaded flag to backend
jankun4 Jun 23, 2024
911483e
Merge pull request #1397 from IntersectMBO/fix/1389-bug-clearing-name…
Sworzen1 Jun 24, 2024
d447847
fix(#1355): fix the navigation to Home from Proposal pillar on discon…
MSzalowski Jun 24, 2024
518acd2
fix(#1349): Change label of Proposal Discussion nav item
MSzalowski Jun 24, 2024
15382c9
Merge pull request #1411 from IntersectMBO/fix/1349-change-proposal-d…
MSzalowski Jun 24, 2024
fa202ec
Merge pull request #1412 from IntersectMBO/fix/1355-user-get-stack
MSzalowski Jun 24, 2024
a72f442
Merge pull request #1424 from IntersectMBO/develop
pmbinapps Jun 24, 2024
af33e43
chore: bump @intersect.mbo/[email protected]
MSzalowski Jun 24, 2024
296c609
Merge pull request #1427 from IntersectMBO/chore/bump-pdf-ui
MSzalowski Jun 25, 2024
6fad7b7
Merge pull request #1429 from IntersectMBO/develop
MSzalowski Jun 25, 2024
36a8938
Merge pull request #1408 from IntersectMBO/1148-stress-test-govtool-b…
MSzalowski Jun 25, 2024
e39f867
Merge pull request #1432 from IntersectMBO/develop
MSzalowski Jun 25, 2024
e93f6c1
[#1417] silence timeout errors
jankun4 Jun 25, 2024
24589ab
Merge pull request #1434 from IntersectMBO/1417-sentry-exception-befo…
MSzalowski Jun 26, 2024
75e7c78
[#1422] silence closed connection error
jankun4 Jun 25, 2024
fa1c0dd
Merge pull request #1435 from IntersectMBO/1422-sentry-exception-warp…
MSzalowski Jun 26, 2024
bdec2d4
feat(#1431): handle disconnected state of proposal pillar
MSzalowski Jun 26, 2024
52404b8
[#1401] add sentryenv field to backend config
jankun4 Jun 25, 2024
f65a43b
Merge pull request #1437 from IntersectMBO/feat/1431-govtool-+-pdf-ha…
MSzalowski Jun 26, 2024
02aac70
chore: add sentry env to backend config makefile
MSzalowski Jun 26, 2024
3787150
chore: bump @intersect.mbo/pdf-ui to v0.2.1
MSzalowski Jun 26, 2024
257283d
Merge pull request #1438 from IntersectMBO/develop
MSzalowski Jun 26, 2024
91ac368
Merge pull request #1439 from IntersectMBO/chore/bump-pdf-ui
MSzalowski Jun 26, 2024
54dfbc6
Merge pull request #1433 from IntersectMBO/1401-provide-env-sentry-se…
MSzalowski Jun 26, 2024
a6d4125
Merge pull request #1440 from IntersectMBO/develop
MSzalowski Jun 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Playwright
run: npx playwright install --with-deps
- name: Build Storybook
run: NODE_OPTIONS="--max-old-space-size=8046" npm run build-storybook --quiet
run: NODE_OPTIONS="--max-old-space-size=8046" npm run build:storybook --quiet
- name: Serve Storybook and run tests
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ changes.

## [Unreleased]

- Added 'sentryenv' field in backend config file [Issue 1401](https://github.com/IntersectMBO/govtool/issues/1401)
- Add wallet connector package [Issue 898](https://github.com/IntersectMBO/govtool/issues/898)
- Change DRep without metadata name from "Sole Voter" to "Direct Voter" [Issue 880](https://github.com/IntersectMBO/govtool/issues/880)
- Inicialize Usersnap into App [Issue 546](https://github.com/IntersectMBO/govtool/issues/546)
Expand Down Expand Up @@ -65,9 +66,14 @@ changes.
- Add PDF pillar [Issue 1090](https://github.com/IntersectMBO/govtool/issues/1090)
- Replace govtool-wrapper governance action creation in favor of pdf-pillar [Issue 1284](https://github.com/IntersectMBO/govtool/issues/1284)
- Add sentry environment config [Issue 1324](https://github.com/IntersectMBO/govtool/issues/1324)
- Add proposal discussion pillar to home page [Issue 1431](https://github.com/IntersectMBO/govtool/issues/1431)

### Fixed

- silenced `Thread killed by timeout manager` sentry log [Issue 1417](https://github.com/IntersectMBO/govtool/issues/1417)
- silenced `Warp: Client closed connection prematurely` error [Issue 1422](https://github.com/IntersectMBO/govtool/issues/1422)
- backend is now compiled with -threaded [Issue 1148](https://github.com/IntersectMBO/govtool/issues/1148)
- drep/get-voting-power no longer throws 500 for non-existing dreps. Instead it returns 0 [Issue 1093](https://github.com/IntersectMBO/govtool/issues/1093)
- proposal/list no longer throws 500 error when proposal's url is incorrect [Issue 1073](https://github.com/IntersectMBO/govtool/issues/1073)
- drep/list sql fix (now the drep type is correct) [Issue 957](https://github.com/IntersectMBO/govtool/issues/957)
- drep/list sql fix (now the latest tx date is correct) [Issue 826](https://github.com/IntersectMBO/govtool/issues/826)
Expand Down Expand Up @@ -99,6 +105,7 @@ changes.
- Fix validation of the GAs with missing references [Issue 1282](https://github.com/IntersectMBO/govtool/issues/1282)
- Fix displaying the GA Markdowns [Issue 1244](https://github.com/IntersectMBO/govtool/issues/1244)
- Fix app crash on voting on the GA without the connected wallet before [Issue 1313](https://github.com/IntersectMBO/govtool/issues/1313)
- Fix the navigation to Home from Proposal pillar on disconnected wallet [Issue 1355](https://github.com/IntersectMBO/govtool/issues/1355)

### Changed

Expand Down Expand Up @@ -131,6 +138,7 @@ changes.
- Changed documents to prepare for open source [Issue 737](https://github.com/IntersectMBO/govtool/issues/737)
- Changed copy on maintenance page [Issue 753](https://github.com/IntersectMBO/govtool/issues/753)
- Update link to docs [Issue 1246](https://github.com/IntersectMBO/govtool/issues/1246)
- Change label of Proposal Discussion nav item [Issue 1349](https://github.com/IntersectMBO/govtool/issues/1349)

### Removed

Expand Down
43 changes: 43 additions & 0 deletions docs/GOVERNANCE_ACTION_SUBMISSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,46 @@ await buildSignSubmitConwayCertTx({
### Step 6: Verify the Governance Action

`buildSignSubmitConwayCertTx` logs the transaction CBOR making it able to be tracked on the transactions tools such as cexplorer.

## Additional steps for using the GovTool metadata validation on the imported Pillar component

```tsx
enum MetadataValidationStatus {
URL_NOT_FOUND = "URL_NOT_FOUND",
INVALID_JSONLD = "INVALID_JSONLD",
INVALID_HASH = "INVALID_HASH",
INCORRECT_FORMAT = "INCORRECT_FORMAT",
}
// Using the props passed to the component
type Props = {
validateMetadata: ({
url,
hash,
standard,
}: {
url: string;
hash: string;
standard: "CIP108";
}) => Promise<{
metadata?: any;
status?: MetadataValidationStatus;
valid: boolean;
}>;
};

import React, { Suspense } from "react";

const SomeImportedPillar: React.FC<Props> = React.lazy(
() => import("path/to/SomeImportedPillar")
);

const SomeWrapperComponent = () => {
const { validateMetadata } = useValidateMutation();

return (
<Suspense fallback={<div>I am lazy loading...</div>}>
<SomeImportedPillar validateMetadata={validateMetadata} />
</Suspense>
);
};
```
14 changes: 9 additions & 5 deletions govtool/backend/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ exceptionHandler :: VVAConfig -> Maybe Request -> SomeException -> IO ()
exceptionHandler vvaConfig mRequest exception = do
print mRequest
print exception
guard (show exception /= "Thread killed by timeout manager")
guard (show exception /= "Warp: Client closed connection prematurely")
let env = sentryEnv vvaConfig
sentryService <-
initRaven
(sentryDSN vvaConfig)
Expand All @@ -154,20 +157,21 @@ exceptionHandler vvaConfig mRequest exception = do
"vva.be"
Error
(formatMessage mRequest exception)
(recordUpdate mRequest exception)
(recordUpdate env mRequest exception)



formatMessage :: Maybe Request -> SomeException -> String
formatMessage Nothing exception = "Exception before request could be parsed: " ++ show exception
formatMessage (Just request) exception = "Exception " ++ show exception ++ " while handling request " ++ show request

recordUpdate :: Maybe Request -> SomeException -> SentryRecord -> SentryRecord
recordUpdate Nothing exception record = record
recordUpdate (Just request) exception record =
recordUpdate :: String -> Maybe Request -> SomeException -> SentryRecord -> SentryRecord
recordUpdate env Nothing exception record = record { srEnvironment = Just env }
recordUpdate env (Just request) exception record =
record
{ srCulprit = Just $ unpack $ rawPathInfo request,
srServerName = unpack <$> requestHeaderHost request
srServerName = unpack <$> requestHeaderHost request,
srEnvironment = Just env
}

shouldDisplayException :: SomeException -> Bool
Expand Down
1 change: 1 addition & 0 deletions govtool/backend/example-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"host" : "localhost",
"cachedurationseconds": 20,
"sentrydsn": "https://username:[email protected]/id",
"sentryenv": "dev",
"metadatavalidationhost": "localhost",
"metadatavalidationport": 3001,
"metadatavalidationmaxconcurrentrequests": 10
Expand Down
6 changes: 6 additions & 0 deletions govtool/backend/src/VVA/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ data VVAConfigInternal
, vVaConfigInternalCacheDurationSeconds :: Int
-- | Sentry DSN
, vVAConfigInternalSentrydsn :: String
-- | Sentry environment
, vVAConfigInternalSentryEnv :: String
-- | Metadata validation service host
, vVAConfigInternalMetadataValidationHost :: Text
-- | Metadata validation service port
Expand All @@ -97,6 +99,7 @@ instance DefaultConfig VVAConfigInternal where
vVAConfigInternalHost = "localhost",
vVaConfigInternalCacheDurationSeconds = 20,
vVAConfigInternalSentrydsn = "https://username:[email protected]/id",
vVAConfigInternalSentryEnv = "development",
vVAConfigInternalMetadataValidationHost = "localhost",
vVAConfigInternalMetadataValidationPort = 3001,
vVAConfigInternalMetadataValidationMaxConcurrentRequests = 10
Expand All @@ -115,6 +118,8 @@ data VVAConfig
, cacheDurationSeconds :: Int
-- | Sentry DSN
, sentryDSN :: String
-- | Sentry environment
, sentryEnv :: String
-- | Metadata validation service host
, metadataValidationHost :: Text
-- | Metadata validation service port
Expand Down Expand Up @@ -161,6 +166,7 @@ convertConfig VVAConfigInternal {..} =
serverHost = vVAConfigInternalHost,
cacheDurationSeconds = vVaConfigInternalCacheDurationSeconds,
sentryDSN = vVAConfigInternalSentrydsn,
sentryEnv = vVAConfigInternalSentryEnv,
metadataValidationHost = vVAConfigInternalMetadataValidationHost,
metadataValidationPort = vVAConfigInternalMetadataValidationPort,
metadataValidationMaxConcurrentRequests = vVAConfigInternalMetadataValidationMaxConcurrentRequests
Expand Down
6 changes: 4 additions & 2 deletions govtool/backend/src/VVA/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ getVotingPower ::
Text ->
m Integer
getVotingPower drepId = withPool $ \conn -> do
[SQL.Only votingPower] <-
result <-
liftIO
(SQL.query @_ @(SQL.Only Scientific) conn getVotingPowerSql $ SQL.Only drepId)
return $ floor votingPower
case result of
[SQL.Only votingPower] -> return $ floor votingPower
[] -> return 0

listDRepsSql :: SQL.Query
listDRepsSql = sqlFrom $(embedFile "sql/list-dreps.sql")
Expand Down
2 changes: 2 additions & 0 deletions govtool/backend/vva-be.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ executable vva-be

hs-source-dirs: app
default-language: Haskell2010
ghc-options: -threaded

library
hs-source-dirs: src
Expand Down Expand Up @@ -118,3 +119,4 @@ library
, VVA.Types
, VVA.Network
, VVA.Metadata
ghc-options: -threaded
Loading
Loading