Skip to content

fix(float): fix create_time_off people_ids field and logged time array response#350

Open
Shubhank-Jonnada wants to merge 5 commits into
masterfrom
fix/float-create-time-off-and-logged-time
Open

fix(float): fix create_time_off people_ids field and logged time array response#350
Shubhank-Jonnada wants to merge 5 commits into
masterfrom
fix/float-create-time-off-and-logged-time

Conversation

@Shubhank-Jonnada

@Shubhank-Jonnada Shubhank-Jonnada commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Two bugs in the Float integration were causing action failures at runtime. Both were caught via live API testing against the Float sandbox and fixed at the source.

What was broken

create_time_off — wrong field name

The Float API expects people_ids (an array), but the integration was sending people_id (a single integer). This caused a 422 every time: "People IDs cannot be blank." Fixed by wrapping the value: "people_ids": [inputs["people_id"]].

create_logged_time / update_logged_time — array response not unwrapped

Float returns these mutations as [{...}] instead of {...}. The integration was passing the raw array straight through, which caused a schema validation error even though the data was being written correctly on Float's side. Fixed by unwrapping: response.data[0] if isinstance(response.data, list) else response.data. GET /logged-time/{id} returns an object and didn't need touching.

Changes

  • float/float.py — two targeted fixes, nothing else touched
  • float/config.json — version bumped 2.0.02.0.1
  • float/tests/test_float_timeoff_unit.py — updated assertion to match new field name
  • float/tests/test_float_integration.py — new integration test suite (see below)

Tests

Read-only (safe to run anytime):

pytest float/tests/test_float_integration.py -m "integration and not destructive"

Destructive (creates/deletes real data on the connected account):

pytest float/tests/test_float_integration.py -m "integration and destructive"

Set FLOAT_API_KEY in .env before running.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

🔍 Integration Validation Results

Commit: 8df79db12088581c4ca3df8147f44463c15dcc44 · fix(float): restore original integration tests, add create_time_off and logged time lifecycle tests
Updated: 2026-06-07T16:51:26Z

Changed directories: float

Check Result
Structure ✅ Passed
Code ✅ Passed
Tests ✅ Passed
README ✅ Passed
Version ⚠️ Passed with warnings
✅ Structure Check output
Validating 1 integration(s)...

============================================================
Integration: float
============================================================
✅ All checks passed!

============================================================
SUMMARY
============================================================
Integrations validated: 1
Total errors: 0
Total warnings: 0

✅ All validations passed!
✅ Code Check output

[notice] A new release of pip is available: 26.1.1 -> 26.1.2
[notice] To update, run: pip install --upgrade pip
----------------------------------------
Checking: float
----------------------------------------

📦 Installing dependencies...

🐍 Checking Python syntax...
   ✅ Syntax OK

📥 Checking imports...
   ✅ Imports OK

📄 Checking JSON files...
   ✅ JSON files OK

🔍 Linting with ruff...
   ✅ Lint OK

🎨 Checking formatting with ruff...
   ✅ Formatting OK

🔒 Scanning for security issues with bandit...
   ✅ Security OK

🛡️ Checking dependencies for vulnerabilities with pip-audit...
   ✅ Dependencies OK

🔗 Checking config-code sync...
   ✅ Config-code sync OK

🔄 Checking fetch patterns...
   ✅ Fetch patterns OK

========================================
✅ CODE CHECK PASSED
========================================
✅ Tests Check output

Integration   Tests  Coverage        Status
-------------------------------------------
float   119/119       72%      ✅ Passed
-------------------------------------------
Total   119/119            ✅ All passed

✅ Tests passed: float
✅ README Check output
========================================
✅ README CHECK PASSED
========================================
⚠️ Version Check output
✅ float: 2.0.0 → 2.0.1 (patch bump) (⚠️ consider a minor bump — new features detected (new functions, classes, or actions))

========================================
✅ VERSION CHECK PASSED
========================================

@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: 4967e82143

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +149 to +150
result = await float_integration.execute_action(
"create_time_off",

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 Clean up created time off in the destructive test

When the documented destructive suite is run, this call creates a real time-off entry for the first person but the test never captures the timeoff_id for cleanup or calls delete_time_off afterward. Each run leaves a July 1, 2026 absence in the connected Float account, which can affect schedules/reports and future test runs; please make this a lifecycle test or delete the created entry in a cleanup path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed create_time_off to send people_ids as an array and unwrapped the array response from create_logged_time/update_logged_time - 306ec07

@TheRealAgentK TheRealAgentK left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Integration PR review

Applied sub-skills: building-integration, writing-unit-tests, writing-integration-tests

🚫 Blockers

None found.

⚠️ Should-fix

  • float/tests/test_float_integration.py new destructive tests: cleanup only happens at the end of the happy path. If an assertion fails after creating a time-off or logged-time record, the test can leave real data behind. Please wrap cleanup in try/finally once timeoff_id / logged_time_id is known.
  • float/tests/test_float_integration.py new destructive tests: they use the first real person/project plus a fixed date (2026-07-01). That can collide with sandbox data and make reruns flaky. Prefer test-specific resources from env vars, disposable resources created by the test, or at least a generated future date to reduce collisions.
  • float/float.py logged-time array unwrap: this new behavior is currently only covered by destructive integration tests. Please add focused unit tests with FetchResponse(data=[...]) for both create_logged_time and update_logged_time so the regression is caught without real API credentials. There currently appears to be no unit coverage for update_logged_time.
  • float/config.json create_time_off output schema still documents people_id, while the new live test asserts people_ids. If Float now returns people_ids, please include that array field so the public action contract matches successful output.

💡 Suggestions

  • For the logged-time unwrap, if Float unexpectedly returns an empty list, response.data[0] will become an IndexError and then an ActionError. A clearer guard/message would make failures easier to debug.

Validation

  • Inspected GitHub checks: green; merge state appears blocked for non-code reasons.
  • Ran locally:
    • validate_integration.py float
    • check_code.py --base-ref origin/master float
    • pytest float/ -v119 passed
    • check_readme.py origin/master float
    • check_version_bump.py origin/master float ✅ with warning suggesting minor bump due detected new test classes/features
  • Integration tests were invoked but skipped locally because FLOAT_API_KEY is not set:
    • pytest float/tests/test_float_integration.py -m "integration and not destructive" -q
    • pytest float/tests/test_float_integration.py -m "integration and destructive" -q
  • Manual diff/security review found no committed secrets; Bandit/security checks passed. GitHub secret scanning could not be run here because GHAS is not enabled for the repo.

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