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

feat: handle eligible deal stats via spark-api #206

Merged
merged 8 commits into from
Sep 2, 2024

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Sep 2, 2024

Rework the endpoints {miner/client/allocator}/:id/deals/eligible/summary to return a (temporary) redirect to spark-api, as discussed in #194 (comment).

Links:

Rework the endpoints `{miner/client/allocator}/:id/deals/eligible/summary`
to return a (temporary) redirect to spark-api.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
.github/workflows/ci.yml Outdated Show resolved Hide resolved
stats/lib/handler.js Outdated Show resolved Hide resolved
stats/lib/handler.js Outdated Show resolved Hide resolved
stats/lib/handler.js Show resolved Hide resolved
@@ -17,7 +18,7 @@ const logger = {
request: ['1', 'true'].includes(REQUEST_LOGGING) ? console.info : () => {}
}

const handler = createHandler({ pgPools, logger })
const handler = createHandler({ SPARK_API_BASE_URL, pgPools, logger })
Copy link
Member

Choose a reason for hiding this comment

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

in this PR, SPARK_API_BASE_URL is never overridden, so it should be removed from args and added to config instead

Copy link
Member Author

Choose a reason for hiding this comment

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

I want to make this configurable via env vars so we can run spark-stats locally with redirects to the local spark-api instance. With your proposal, I would have to edit the local config file and then remember to discard the changes before committing to git.

In that light, do you still prefer to move this to the config file? I don't have a strong opinion.

Copy link
Member

Choose a reason for hiding this comment

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

Got it, I didn't see that possibility. I never run these services in dev 😅

@juliangruber
Copy link
Member

@bajtos there's a type error

bajtos and others added 3 commits September 2, 2024 16:24
Co-authored-by: Julian Gruber <julian@juliangruber.com>
Co-authored-by: Julian Gruber <julian@juliangruber.com>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos
Copy link
Member Author

bajtos commented Sep 2, 2024

@bajtos there's a type error

Do you know why we don't run npm test:types as part of npm test? Was it an intentional decision? If not, then I'd like to fix that.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos
Copy link
Member Author

bajtos commented Sep 2, 2024

All CI checks are green now 🚀

@bajtos bajtos enabled auto-merge (squash) September 2, 2024 14:42
@juliangruber
Copy link
Member

@bajtos there's a type error

Do you know why we don't run npm test:types as part of npm test? Was it an intentional decision? If not, then I'd like to fix that.

Yes please add that 👌

stats/lib/handler.js Outdated Show resolved Hide resolved
stats/lib/handler.js Outdated Show resolved Hide resolved
stats/lib/handler.js Outdated Show resolved Hide resolved
stats/lib/handler.js Outdated Show resolved Hide resolved
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos
Copy link
Member Author

bajtos commented Sep 2, 2024

@bajtos there's a type error

Do you know why we don't run npm test:types as part of npm test? Was it an intentional decision? If not, then I'd like to fix that.

Yes please add that 👌

#208

Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

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

👏

@bajtos bajtos merged commit d8b7e91 into main Sep 2, 2024
10 checks passed
@bajtos bajtos deleted the redirect-eligible-deals-query-to-spark-api branch September 2, 2024 15:14
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.

2 participants