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

Add contests↔︎sponsors check to validate script #7878

Open
natevw opened this issue Mar 1, 2023 · 1 comment
Open

Add contests↔︎sponsors check to validate script #7878

natevw opened this issue Mar 1, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@natevw
Copy link
Contributor

natevw commented Mar 1, 2023

There are some various checks in bin/validate.js that happen as part of the CI here:

    await validateHandles();
    await validateTeams();
    await validateOrganizations();
    await validateFindings();

But one other one that could be helpful is to validate the contests vs. sponsor data to flag any mismatch there. For example if a contest has been added in the main branch, a stale side branch can start getting a sort of cryptic error like:

2:26:22 PM: error Building static HTML failed for path "/contests/2023-03-aragon-protocol-contest"
2:26:22 PM: 
2:26:22 PM:   182 |               <div className="contest-page__project">
2:26:22 PM:   183 |                 <div className="contest-page__project-link project-link">
2:26:22 PM: > 184 |                   <a href={sponsor.link}>
2:26:22 PM:       |                                    ^
2:26:22 PM:   185 |                     <img
2:26:22 PM:   186 |                       src={sponsor.image.childImageSharp.resize.src}
2:26:22 PM:   187 |                       alt={sponsor.name}
2:26:22 PM: 
2:26:22 PM:   WebpackError: TypeError: Cannot read properties of null (reading 'link')

which isn't obvious but basically means the API is returning a contest but the dev branch is missing the sponsor info and avatar. The validate could detect this more directly and flag it in a clearer way to make it easier to troubleshoot.

[Noting that the bigger picture fix might be to keep the two data sources from getting out of sync in the first place, but that might be a longer-term effort.]

@natevw natevw added the enhancement New feature or request label Mar 1, 2023
@natevw
Copy link
Contributor Author

natevw commented Mar 3, 2023

cf. #6203 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant