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

fix: use Lead Style from MP tick import instead of Style #1259

Merged

Conversation

glassbead0
Copy link
Contributor

@glassbead0 glassbead0 commented Jan 23, 2025


name: Pull request
about: Create a pull request
title: 'correctly import attemptStyle from MP tick import'
labels: ''
assignees: ''


What type of PR is this?(check all applicable)

  • refactor
  • feature
  • bug fix
  • documentation
  • optimization
  • other

Description

When importing ticks from Mountain Project, the attemptStyle field was being populated with the Style field from MP. It should use the Lead Style field instead.

Related Issues

Issue #
The issue was created in openbeta-graphql, but the code is in open-tacos.

OpenBeta/openbeta-graphql#424

What this PR achieves

When converting a MPTick to a Tick object, set attemptStyle on Tick to be the value from Lead Style on MPTick (if present).

Notes

I don't see an obvious way to write tests for this. everything in tests/ticks.ts mocks out Tick objects after the conversion from MPTick has already happened, so a new test would probably have to be more of an end-to-end tests.

Below screenshot shows imported ticks locally, and the attemptType fields being populated with correct values.
Screenshot 2025-01-23 at 3 44 06 PM

@Vichy97
Copy link
Collaborator

Vichy97 commented Jan 23, 2025

Should we also coerce imported fields from MP into the set of possible values defined in OpenBeta/openbeta-graphql#444? That could also be a separate PR, but it is necessary in order to make the change to allowable types

@glassbead0
Copy link
Contributor Author

Update: I allowed null for both style and attemptType. The test pass, but i'm not sure if there's anywhere else in the codebase that needs updating to allow null values for these 2 fields.

@glassbead0 glassbead0 force-pushed the import_mp_attempt_style_correctly_424 branch from 9826bc3 to 010ed46 Compare January 25, 2025 19:26
@vnugent
Copy link
Contributor

vnugent commented Jan 26, 2025

Testing the PR locally (connecting to staging api, not local api server) I'm getting ticks validation failed: attemptType: Path attemptType is required.. The error went away when I added 'N/A' back.


Screenshot 2025-01-26 at 11 30 29 AM

@vnugent
Copy link
Contributor

vnugent commented Jan 26, 2025

can you also increase the timeout to 180000 (3 mins)?
https://github.com/OpenBeta/open-tacos/pull/1259/files#diff-cc45e63ea0bcf9c96ed981bc5e05b06e060078e406cab1f16930ad29b93b9c38R76

@glassbead0
Copy link
Contributor Author

The issue of null vs 'N/A'...etc should be coordinated among these 3 PRs:

Probably best discussed with mouth words if we meet this week.

* convert 'Fell/Hung' to 'Attempt' since thats what OB uses
* add .tool-versions to gitignore for anyone using asdf
* somewhat complicated logic for other edge cases
* references md document in openbeta-graphql for ease
  of understanding the logic
@glassbead0 glassbead0 force-pushed the import_mp_attempt_style_correctly_424 branch from 7d12e43 to 4ccfb95 Compare January 31, 2025 00:25
@vnugent vnugent merged commit aa7c9cb into OpenBeta:develop Feb 5, 2025
3 checks passed
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.

3 participants