Skip to content

test: Cover actions permission JSON marshaling#4250

Open
KirtiRamchandani wants to merge 1 commit into
google:masterfrom
KirtiRamchandani:test/actions-permissions-marshal
Open

test: Cover actions permission JSON marshaling#4250
KirtiRamchandani wants to merge 1 commit into
google:masterfrom
KirtiRamchandani:test/actions-permissions-marshal

Conversation

@KirtiRamchandani
Copy link
Copy Markdown
Contributor

Problem

Issue #55 tracks adding JSON marshal coverage for public resource types that implement String().

Root cause

Several Actions permission-related response types had String() implementations but no matching marshal tests, leaving their JSON field names and omitted-empty behavior uncovered.

Solution

Add marshal tests for the remaining Actions permission and retention structs in the existing test files:

  • ArtifactPeriod
  • ActionsPermissionsEnterprise
  • SelfHostRunnerPermissionsEnterprise
  • SelfHostedRunnersSettingsOrganization
  • WorkflowsPermissions
  • ContributorApprovalPermissions

Tests

  • go test ./github -run 'Test(ArtifactPeriod|ActionsPermissionsEnterprise|SelfHostRunnerPermissionsEnterprise|SelfHostedRunnersSettingsOrganization|WorkflowsPermissions|ContributorApprovalPermissions)_Marshal'
  • go test ./github
  • go test ./...
  • git diff --check

Fixes part of #55.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.48%. Comparing base (c207b27) to head (5126bb3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4250   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files         190      190           
  Lines       19178    19178           
=======================================
  Hits        18695    18695           
  Misses        268      268           
  Partials      215      215           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis changed the title test: cover actions permission JSON marshalling test: Cover actions permission JSON marshalling May 26, 2026
@gmlewis gmlewis changed the title test: Cover actions permission JSON marshalling test: Cover actions permission JSON marshaling May 26, 2026
Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @KirtiRamchandani!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants