Skip to content

Conversation

@jbristow
Copy link
Contributor

Summary of Change

Roles were being added willy nilly and reflected the author's poor understanding of GitHub permissions and how they interact with the UI and legacy implementations.

This fixes them and adds back a little info about permissions where we can.

Before Review

  • Unit Tests are Added/Updated and meet at-least 85% coverage criteria for that feature

Before Merge

  • Ran/Functionally Tested in Dev Environment
  • Documentation Is Updated (Where Appropriate)

Comment on lines -30 to -32
if permission:
output["permission"] = permission
return output
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is unnecessary and potentially confusing, removed

@github-actions
Copy link
Contributor

github-actions bot commented Sep 10, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
nodestream_github
   audit.py55296%80–83
   plugin.py4175%6
   repos.py94397%37, 81, 85
   teams.py34197%63
   users.py26196%33
nodestream_github/client
   githubclient.py2553686%91–92, 97–98, 191, 209, 252, 269, 335–336, 352–353, 415–416, 436–437, 472–473, 494–495, 507–508, 528–529, 538–540, 567–568, 588–589, 599–601, 618–619
nodestream_github/transformer
   repo.py42198%43
TOTAL6384593% 

Tests Skipped Failures Errors Time
72 0 💤 0 ❌ 0 🔥 3.023s ⏱️

Comment on lines -26 to -28
if affiliation:
output["affiliation"] = affiliation
return output
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is unnecessary and potentially confusing, removed

security_and_analysis_advanced_security: !jmespath 'security_and_analysis.advanced_security.status'
security_and_analysis_secret_scanning: !jmespath 'security_and_analysis.secret_scanning.status'
security_and_analysis_secret_scanning_push_protection: !jmespath 'security_and_analysis.secret_scanning_push_protection.status'
- type: source_node
Copy link
Contributor Author

Choose a reason for hiding this comment

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

curse ye, autoformat

if self.include_repositories:
full_org["repositories"] = [
simplify_repo(
repo, permission=full_org.get("default_repository_permission")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Duplicating this onto the relationship was a mistake.

affiliation=CollaboratorAffiliation.DIRECT,
):
collaborators.append(simplify_user(user, affiliation="direct"))
collaborators.append(simplify_user(user) | {"affiliation": "direct"})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

see how much nicer this is?

"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"permission": "admin",
"url": "https://HOSTNAME/repos/octocat/Hello-World",
"role_name": "read",
Copy link
Contributor Author

@jbristow jbristow Sep 10, 2025

Choose a reason for hiding this comment

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

note that I am making this "role_name" now in order to be consistent with the GitHub REST api. It is up to the end user to change it if they want.

Previously, the team.permission value was copied up into team.repos[].permission and this turns out to be overly confusing.

outbound: false
key_normalization:
do_lowercase_strings: false

Copy link
Contributor

Choose a reason for hiding this comment

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

if we remove the permission in the IN_ORGANIZATION relationship, where would we store it in the next iteration? Will that be done through the simplify_repo/simplify_user changes you made in /relationship/repository.py and /relationship/user.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in org.default_repository_permissions which is where I've been writing queries from. I don't think we're even writing this permission to our data since our yaml is a custom version of this.

@jbristow jbristow merged commit 08a2075 into master Sep 11, 2025
4 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