Skip to content

wip#1

Open
GibranAlfa wants to merge 1 commit into
mainfrom
wellbore-mappings
Open

wip#1
GibranAlfa wants to merge 1 commit into
mainfrom
wellbore-mappings

Conversation

@GibranAlfa

Copy link
Copy Markdown
Owner

Resolves #issue

Briefly describe changes here, e.g. "Added a precise description about the
changes made to the code, and what the PR is solving."

Checklist

  • Tests added (if not, comment why)
  • Test coverage equal or up from main (run pytest with --cov=src/ --cov-report term-missing)
  • If not squash merging, every commit passes tests
  • Appropriate commit prefix and precise commit message used
  • All debug prints and unnecessary comments removed
  • Docstrings are correct and updated
  • Documentation is updated, if necessary
  • Latest main rebased/merged into branch
  • Added comments on this PR where appropriate to help reviewers
  • Moved issue status on project board
  • Checked the boxes in this checklist ✅

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 410ab1cf2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/src/services/mappings.ts
@GibranAlfa

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f70f1b052c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +93 to +95
return {
smdaHeaders: [...headersByUuid.values()],
isPending: results.some((result) => result.isPending),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Block suggestions when SMDA field lookup fails

When a project has multiple SMDA fields and one well_headers query errors while another succeeds, this combine still returns the successful subset with isPending: false; SmdaMappings only disables suggestion generation on wellHeadersPending, so users can generate and save matches against an incomplete SMDA target list after a field-specific outage or 422/503. Track result.isError/failed fields and block or surface the error instead of enabling suggestions with partial headers.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex address this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Testing

  • pnpm --dir frontend exec tsc -b --pretty false
  • ⚠️ pnpm --dir frontend lint (environment limitation: the script references tools/biome, which is not present)
  • ⚠️ pnpm --dir frontend exec biome check . && pnpm --dir frontend exec eslint . (environment limitation: biome is not installed)

View task →

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex Push that commit to this PR

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Testing

  • pnpm --dir frontend exec tsc -b --pretty false
  • ⚠️ pnpm --dir frontend lint — failed because tools/biome is not present in this environment.

View task →

Comment on lines +164 to +165
if (simulatorName) {
updated.push({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid adding duplicate simulator mappings

When an RMS well already has multiple simulator rows, editing one row and entering a simulator name that exists on another row removes only the original row and then unconditionally appends the new mapping here. That leaves duplicate simulator mappings in mappings.json, and createWellboreMappingRows will render duplicate rows for the same RMS/simulator pair. Skip the append when the remaining mappings already contain this simulator target.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex is this a valid comment? An RMS well cannot have multiple simulator rows, it will fail API validation

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Answer

I would not consider that comment valid as written.

The codebase appears to intentionally support multiple simulator mappings/rows for a single RMS well:

However, the underlying review concern is still valid if the issue is duplicate mappings for the same RMS/simulator pair. In updateWellboreMapping, the function removes only the first matching original simulator mapping and then unconditionally appends the edited simulator mapping when simulatorName is non-empty. frontend/src/components/project/wellboreMappings/functions.tsL142-L165 That can create a duplicate if another remaining row for the same RMS well already has the target simulator name. frontend/src/components/project/wellboreMappings/functions.tsL148-L172

So I’d rephrase the comment to something like:

This should avoid adding a duplicate RMS-to-simulator mapping for the same RMS well and simulator name. Multiple simulator rows per RMS well appear to be supported, but duplicate rows for the same RMS/simulator pair can be produced here because the code removes only the edited row and then always appends the new simulator target.

Testing / checks

  • find .. -name AGENTS.md -print && git status --short && sed -n '130,190p' frontend/src/components/project/wellboreMappings/functions.ts
  • sed -n '1,140p' frontend/src/components/project/wellboreMappings/functions.ts && rg "updateWellboreMapping" -n
  • sed -n '240,270p' frontend/src/client/types.gen.ts && sed -n '465,540p' frontend/src/client/schemas.gen.ts && sed -n '190,370p' frontend/src/components/project/wellboreMappings/functions.ts
  • rg "simulator" frontend/src/components/project/wellboreMappings -n | head -80 && find frontend/src -name '*test*' -o -name '*spec*' | head -50
  • nl -ba frontend/src/components/project/wellboreMappings/functions.ts | sed -n '63,110p;138,174p' && nl -ba frontend/src/client/types.gen.ts | sed -n '242,264p' && nl -ba frontend/src/components/project/wellboreMappings/WellboreMappingsTable.tsx | sed -n '296,306p'

View task →

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

  • Updated updateWellboreMapping so editing a wellbore row removes all existing primary RMS-to-simulator mappings for that RMS well before appending the edited simulator mapping, preventing saves that violate the API’s one-cross-system-mapping-per-target-system validation.
  • Kept the edited simulator append path unchanged after the cleanup, so a non-empty simulator name still writes one replacement primary simulator mapping.
  • Committed the change on the current branch with commit 497828c (fix: replace existing simulator mapping) and created a PR titled fix: replace existing wellbore simulator mappings.

Testing

  • pnpm --dir frontend exec tsc -b --pretty false
  • ⚠️ pnpm --dir frontend lint — failed because tools/biome is not present in this environment.

View task →

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.

1 participant