Skip to content

Comments

chore: add loggers in attachment upload#920

Merged
ashwin1111 merged 3 commits intomasterfrom
add-loggers-attachment
Feb 20, 2026
Merged

chore: add loggers in attachment upload#920
ashwin1111 merged 3 commits intomasterfrom
add-loggers-attachment

Conversation

@ashwin1111
Copy link
Contributor

@ashwin1111 ashwin1111 commented Feb 20, 2026

Description

Please add PR description here, add screenshots if needed

Clickup

https://app.clickup.com/t/

Summary by CodeRabbit

  • Chores
    • Enhanced logging around attachment handling to improve observability during the attachment upload process.
    • Improved internal consistency in attachment naming conventions.

@github-actions github-actions bot added the size/XS Extra Small PR label Feb 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Warning

Rate limit exceeded

@ashwin1111 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

The pull request adds informational logging around attachment handling operations in the load_attachments function and introduces a local attachment_name variable to standardize naming convention as "{id}_{name}". The core export and upload logic remains unchanged.

Changes

Cohort / File(s) Summary
Attachment Logging & Naming
apps/netsuite/tasks.py
Added informational logging around attachment folder creation, file URL generation/upload, and final URL retrieval. Introduced local attachment_name variable to centralize the "{id}_{name}" naming pattern used in upload payloads.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 With logs now bright and names held tight,
The attachments dance in organized light,
One file, one change, so clean and neat,
The refactor is subtle, the victory sweet!
Clarity blooms where confusion once hid, 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains placeholder text and an incomplete ClickUp link, missing substantive details about the changes and their rationale. Replace placeholder text with a clear description of why logging was added, what specific improvements it enables, and complete the ClickUp link.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding logging to attachment upload functionality in the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-loggers-attachment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
apps
   exceptions.py431467%23, 29, 35–40, 46, 52–57, 63, 69, 75–76, 88–90
apps/fyle
   actions.py132993%32–35, 280, 328–332
   constants.py10100% 
   helpers.py2645081%112–114, 123, 134–138, 176–184, 271, 329, 332–348, 373–379, 382, 385, 458–482
   models.py3221197%298–300, 304–306, 321, 360–364, 537, 556
   queue.py48394%90–99
   serializers.py340100% 
   signals.py33391%30–32
   tasks.py5059182%169–170, 177–179, 209–210, 237–238, 265–266, 280–285, 310, 320, 330–333, 342, 352–381, 392–428, 476–478, 933–934, 983–986, 993–994, 1015–1016, 1057–1058, 1065–1066, 1068–1069, 1072–1073, 1075–1076, 1088–1096
   views.py1981393%80, 93, 96, 180, 399, 436–444, 460–464
apps/internal
   actions.py22291%15–16
   tasks.py52787%41–46, 73
   views.py390100% 
apps/mappings
   constants.py30100% 
   exceptions.py1257441%58, 61–62, 65–66, 69–74, 99–178
   helpers.py42783%65–69, 76–78
   models.py460100% 
   schedules.py120100% 
   serializers.py36197%38
   signals.py100991%156–158, 162–163, 190–196
   tasks.py1921692%33, 56, 126–127, 225–226, 237, 345–349, 402–405, 466–472
   views.py43198%104
apps/netsuite
   actions.py34391%45, 56–57
   connector.py94911588%82–87, 127, 143, 146, 149, 155, 236, 248, 259, 452, 469, 473, 503, 520, 524, 607, 622, 626–627, 646, 719, 722–726, 783, 836, 876, 902, 1007, 1012–1015, 1026–1029, 1038–1039, 1091–1092, 1132, 1325–1339, 1362–1364, 1565, 1567, 1570, 1582, 1585, 1730–1733, 1762–1768, 1818, 1947–1948, 1954, 2070, 2108–2137, 2155–2158, 2373, 2673, 2828, 2839, 2853–2854, 2858–2860
   errors.py624429%21–26, 46–70, 76–84, 103–113, 119, 134–147
   errors_reference.py40100% 
   exceptions.py1392979%85, 95–96, 138, 151–152, 187–209, 212–235
   helpers.py804248%20–29, 60–61, 92–114, 119–143, 153–159
   models.py6682596%66, 99, 127, 164, 197, 252, 254, 258, 299, 320, 553, 557, 580–581, 770, 774, 797–798, 1004, 1008, 1026–1027, 1206, 1228, 1232
   queue.py141994%52, 102–106, 162–166, 227–231, 286–290
   serializers.py160100% 
   signals.py46589%31–32, 41, 66–67
   tasks.py87113085%199, 208, 255–256, 263, 269, 486–490, 498–499, 552–553, 583–587, 595–596, 668–669, 690–694, 702–703, 751–752, 782–786, 794–795, 843–844, 1045–1051, 1174, 1203–1205, 1212–1217, 1256, 1326–1349, 1375–1377, 1399, 1414, 1418–1424, 1486–1494, 1578–1599, 1642–1647, 1656–1682
   views.py110595%120, 198–199, 258–259
apps/tasks
   helpers.py100100% 
   models.py670100% 
   serializers.py60100% 
   views.py190100% 
apps/users
   helpers.py120100% 
   models.py140100% 
   views.py160100% 
apps/workspaces
   actions.py463720%16–121
   enums.py50100% 
   helpers.py6267%7, 15
   models.py1560100% 
   permissions.py33973%24, 43–51
   serializers.py490100% 
   signals.py330100% 
   tasks.py1842089%74–78, 101, 119–120, 198, 229–230, 345–348, 369–370, 384–388
   utils.py13562%24–33
   views.py2601594%103–106, 503–518
apps/workspaces/apis/advanced_settings
   serializers.py88397%203, 206, 209
   triggers.py120100% 
   views.py70100% 
apps/workspaces/apis/errors
   serializers.py200100% 
   views.py110100% 
apps/workspaces/apis/export_settings
   helpers.py71396%133–135
   serializers.py95397%202, 205, 208
   triggers.py36489%41, 56–57, 66
   views.py110100% 
apps/workspaces/apis/import_settings
   serializers.py74199%172
   triggers.py792272%26–41, 44–62
   views.py110100% 
apps/workspaces/apis/map_employees
   serializers.py37295%23, 58
   triggers.py6183%10
   views.py11464%11, 18–20
workers
   actions.py410100% 
   helpers.py460100% 
   worker.py56395%77–78, 125
TOTAL705385288% 

Tests Skipped Failures Errors Time
396 0 💤 0 ❌ 0 🔥 42.329s ⏱️

@github-actions
Copy link


Diff Coverage
Diff: origin/master..HEAD, staged and unstaged changes

apps/netsuite/tasks.py (100%)

Total: 9 lines
Missing: 0 lines
Coverage: 100%

@github-actions
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
apps
   exceptions.py431467%23, 29, 35–40, 46, 52–57, 63, 69, 75–76, 88–90
apps/fyle
   actions.py132993%32–35, 280, 328–332
   constants.py10100% 
   helpers.py2645081%112–114, 123, 134–138, 176–184, 271, 329, 332–348, 373–379, 382, 385, 458–482
   models.py3221197%298–300, 304–306, 321, 360–364, 537, 556
   queue.py48394%90–99
   serializers.py340100% 
   signals.py33391%30–32
   tasks.py5059182%169–170, 177–179, 209–210, 237–238, 265–266, 280–285, 310, 320, 330–333, 342, 352–381, 392–428, 476–478, 933–934, 983–986, 993–994, 1015–1016, 1057–1058, 1065–1066, 1068–1069, 1072–1073, 1075–1076, 1088–1096
   views.py1981393%80, 93, 96, 180, 399, 436–444, 460–464
apps/internal
   actions.py22291%15–16
   tasks.py52787%41–46, 73
   views.py390100% 
apps/mappings
   constants.py30100% 
   exceptions.py1257441%58, 61–62, 65–66, 69–74, 99–178
   helpers.py42783%65–69, 76–78
   models.py460100% 
   schedules.py120100% 
   serializers.py36197%38
   signals.py100991%156–158, 162–163, 190–196
   tasks.py1921692%33, 56, 126–127, 225–226, 237, 345–349, 402–405, 466–472
   views.py43198%104
apps/netsuite
   actions.py34391%45, 56–57
   connector.py94911588%82–87, 127, 143, 146, 149, 155, 236, 248, 259, 452, 469, 473, 503, 520, 524, 607, 622, 626–627, 646, 719, 722–726, 783, 836, 876, 902, 1007, 1012–1015, 1026–1029, 1038–1039, 1091–1092, 1132, 1325–1339, 1362–1364, 1565, 1567, 1570, 1582, 1585, 1730–1733, 1762–1768, 1818, 1947–1948, 1954, 2070, 2108–2137, 2155–2158, 2373, 2673, 2828, 2839, 2853–2854, 2858–2860
   errors.py624429%21–26, 46–70, 76–84, 103–113, 119, 134–147
   errors_reference.py40100% 
   exceptions.py1392979%85, 95–96, 138, 151–152, 187–209, 212–235
   helpers.py804248%20–29, 60–61, 92–114, 119–143, 153–159
   models.py6682596%66, 99, 127, 164, 197, 252, 254, 258, 299, 320, 553, 557, 580–581, 770, 774, 797–798, 1004, 1008, 1026–1027, 1206, 1228, 1232
   queue.py141994%52, 102–106, 162–166, 227–231, 286–290
   serializers.py160100% 
   signals.py46589%31–32, 41, 66–67
   tasks.py87113085%199, 208, 255–256, 263, 269, 486–490, 498–499, 552–553, 583–587, 595–596, 668–669, 690–694, 702–703, 751–752, 782–786, 794–795, 843–844, 1045–1051, 1174, 1203–1205, 1212–1217, 1256, 1326–1349, 1375–1377, 1399, 1414, 1418–1424, 1486–1494, 1578–1599, 1642–1647, 1656–1682
   views.py110595%120, 198–199, 258–259
apps/tasks
   helpers.py100100% 
   models.py670100% 
   serializers.py60100% 
   views.py190100% 
apps/users
   helpers.py120100% 
   models.py140100% 
   views.py160100% 
apps/workspaces
   actions.py463720%16–121
   enums.py50100% 
   helpers.py6267%7, 15
   models.py1560100% 
   permissions.py33973%24, 43–51
   serializers.py490100% 
   signals.py330100% 
   tasks.py1842089%74–78, 101, 119–120, 198, 229–230, 345–348, 369–370, 384–388
   utils.py13562%24–33
   views.py2601594%103–106, 503–518
apps/workspaces/apis/advanced_settings
   serializers.py88397%203, 206, 209
   triggers.py120100% 
   views.py70100% 
apps/workspaces/apis/errors
   serializers.py200100% 
   views.py110100% 
apps/workspaces/apis/export_settings
   helpers.py71396%133–135
   serializers.py95397%202, 205, 208
   triggers.py36489%41, 56–57, 66
   views.py110100% 
apps/workspaces/apis/import_settings
   serializers.py74199%172
   triggers.py792272%26–41, 44–62
   views.py110100% 
apps/workspaces/apis/map_employees
   serializers.py37295%23, 58
   triggers.py6183%10
   views.py11464%11, 18–20
workers
   actions.py410100% 
   helpers.py460100% 
   worker.py56395%77–78, 125
TOTAL705385288% 

Tests Skipped Failures Errors Time
396 0 💤 0 ❌ 0 🔥 43.419s ⏱️

@github-actions
Copy link


Diff Coverage
Diff: origin/master..HEAD, staged and unstaged changes

apps/netsuite/tasks.py (100%)

Total: 9 lines
Missing: 0 lines
Coverage: 100%

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/netsuite/tasks.py (1)

134-147: ⚠️ Potential issue | 🟡 Minor

Inconsistent workspace identifier in upload log: workspace.name vs workspace.id.

Line 134 logs workspace.name while every other logger call in this function (lines 114, 119, 124, 126) — including the paired "success" counterpart at line 147 — logs workspace.id. This makes cross-log correlation harder when filtering by workspace ID.

🛠️ Proposed fix
-                    logger.info('Uploading attachment %s for workspace %s', attachment_name, workspace.name)
+                    logger.info('Uploading attachment %s for workspace %s', attachment_name, workspace.id)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/netsuite/tasks.py` around lines 134 - 147, The log call before uploading
uses workspace.name while all other logs use workspace.id, causing inconsistent
workspace identifiers; update the pre-upload logger.info (the call that logs
'Uploading attachment %s for workspace %s') to use workspace.id instead of
workspace.name so both the pre-upload and the success log (and other logs)
consistently reference workspace.id; verify the surrounding context in the
function that calls netsuite_connection.connection.files.post and uses
attachment_name to ensure both logs format the same identifier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@apps/netsuite/tasks.py`:
- Around line 134-147: The log call before uploading uses workspace.name while
all other logs use workspace.id, causing inconsistent workspace identifiers;
update the pre-upload logger.info (the call that logs 'Uploading attachment %s
for workspace %s') to use workspace.id instead of workspace.name so both the
pre-upload and the success log (and other logs) consistently reference
workspace.id; verify the surrounding context in the function that calls
netsuite_connection.connection.files.post and uses attachment_name to ensure
both logs format the same identifier.

@ashwin1111 ashwin1111 deployed to CI Environment February 20, 2026 08:03 — with GitHub Actions Active
@github-actions
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
apps
   exceptions.py431467%23, 29, 35–40, 46, 52–57, 63, 69, 75–76, 88–90
apps/fyle
   actions.py132993%32–35, 280, 328–332
   constants.py10100% 
   helpers.py2645081%112–114, 123, 134–138, 176–184, 271, 329, 332–348, 373–379, 382, 385, 458–482
   models.py3221197%298–300, 304–306, 321, 360–364, 537, 556
   queue.py48394%90–99
   serializers.py340100% 
   signals.py33391%30–32
   tasks.py5059182%169–170, 177–179, 209–210, 237–238, 265–266, 280–285, 310, 320, 330–333, 342, 352–381, 392–428, 476–478, 933–934, 983–986, 993–994, 1015–1016, 1057–1058, 1065–1066, 1068–1069, 1072–1073, 1075–1076, 1088–1096
   views.py1981393%80, 93, 96, 180, 399, 436–444, 460–464
apps/internal
   actions.py22291%15–16
   tasks.py52787%41–46, 73
   views.py390100% 
apps/mappings
   constants.py30100% 
   exceptions.py1257441%58, 61–62, 65–66, 69–74, 99–178
   helpers.py42783%65–69, 76–78
   models.py460100% 
   schedules.py120100% 
   serializers.py36197%38
   signals.py100991%156–158, 162–163, 190–196
   tasks.py1921692%33, 56, 126–127, 225–226, 237, 345–349, 402–405, 466–472
   views.py43198%104
apps/netsuite
   actions.py34391%45, 56–57
   connector.py94911588%82–87, 127, 143, 146, 149, 155, 236, 248, 259, 452, 469, 473, 503, 520, 524, 607, 622, 626–627, 646, 719, 722–726, 783, 836, 876, 902, 1007, 1012–1015, 1026–1029, 1038–1039, 1091–1092, 1132, 1325–1339, 1362–1364, 1565, 1567, 1570, 1582, 1585, 1730–1733, 1762–1768, 1818, 1947–1948, 1954, 2070, 2108–2137, 2155–2158, 2373, 2673, 2828, 2839, 2853–2854, 2858–2860
   errors.py624429%21–26, 46–70, 76–84, 103–113, 119, 134–147
   errors_reference.py40100% 
   exceptions.py1392979%85, 95–96, 138, 151–152, 187–209, 212–235
   helpers.py804248%20–29, 60–61, 92–114, 119–143, 153–159
   models.py6682596%66, 99, 127, 164, 197, 252, 254, 258, 299, 320, 553, 557, 580–581, 770, 774, 797–798, 1004, 1008, 1026–1027, 1206, 1228, 1232
   queue.py141994%52, 102–106, 162–166, 227–231, 286–290
   serializers.py160100% 
   signals.py46589%31–32, 41, 66–67
   tasks.py87113085%199, 208, 255–256, 263, 269, 486–490, 498–499, 552–553, 583–587, 595–596, 668–669, 690–694, 702–703, 751–752, 782–786, 794–795, 843–844, 1045–1051, 1174, 1203–1205, 1212–1217, 1256, 1326–1349, 1375–1377, 1399, 1414, 1418–1424, 1486–1494, 1578–1599, 1642–1647, 1656–1682
   views.py110595%120, 198–199, 258–259
apps/tasks
   helpers.py100100% 
   models.py670100% 
   serializers.py60100% 
   views.py190100% 
apps/users
   helpers.py120100% 
   models.py140100% 
   views.py160100% 
apps/workspaces
   actions.py463720%16–121
   enums.py50100% 
   helpers.py6267%7, 15
   models.py1560100% 
   permissions.py33973%24, 43–51
   serializers.py490100% 
   signals.py330100% 
   tasks.py1842089%74–78, 101, 119–120, 198, 229–230, 345–348, 369–370, 384–388
   utils.py13562%24–33
   views.py2601594%103–106, 503–518
apps/workspaces/apis/advanced_settings
   serializers.py88397%203, 206, 209
   triggers.py120100% 
   views.py70100% 
apps/workspaces/apis/errors
   serializers.py200100% 
   views.py110100% 
apps/workspaces/apis/export_settings
   helpers.py71396%133–135
   serializers.py95397%202, 205, 208
   triggers.py36489%41, 56–57, 66
   views.py110100% 
apps/workspaces/apis/import_settings
   serializers.py74199%172
   triggers.py792272%26–41, 44–62
   views.py110100% 
apps/workspaces/apis/map_employees
   serializers.py37295%23, 58
   triggers.py6183%10
   views.py11464%11, 18–20
workers
   actions.py410100% 
   helpers.py460100% 
   worker.py56395%77–78, 125
TOTAL705385288% 

Tests Skipped Failures Errors Time
396 0 💤 0 ❌ 0 🔥 40.454s ⏱️

@github-actions
Copy link


Diff Coverage
Diff: origin/master..HEAD, staged and unstaged changes

apps/netsuite/tasks.py (100%)

Total: 9 lines
Missing: 0 lines
Coverage: 100%

@ashwin1111 ashwin1111 merged commit f0d661b into master Feb 20, 2026
8 checks passed
ashwin1111 added a commit that referenced this pull request Feb 20, 2026
* chore: add loggers in attachment upload

* fix

* fix

(cherry picked from commit f0d661b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra Small PR

Development

Successfully merging this pull request may close these issues.

2 participants