Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modularity support #400

Merged
merged 1 commit into from
Dec 7, 2023
Merged

modularity support #400

merged 1 commit into from
Dec 7, 2023

Conversation

furlongm
Copy link
Owner

@furlongm furlongm commented Apr 7, 2022

No description provided.

repos/utils.py Outdated Show resolved Hide resolved
@furlongm furlongm force-pushed the modularity branch 3 times, most recently from a759423 to cb34c3f Compare April 11, 2022 03:11
modules/models.py Outdated Show resolved Hide resolved
modules/models.py Outdated Show resolved Hide resolved
@furlongm furlongm force-pushed the modularity branch 5 times, most recently from bb2bb27 to 46a397b Compare April 12, 2022 03:20
Copy link

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Worth considering. View full project report here.

modules/models.py Outdated Show resolved Hide resolved
packages/utils.py Outdated Show resolved Hide resolved
packages/utils.py Outdated Show resolved Hide resolved
repos/utils.py Outdated Show resolved Hide resolved
modules/models.py Outdated Show resolved Hide resolved
modules/serializers.py Outdated Show resolved Hide resolved
modules/views.py Outdated Show resolved Hide resolved
modules/views.py Outdated Show resolved Hide resolved
repos/utils.py Outdated Show resolved Hide resolved
repos/utils.py Outdated Show resolved Hide resolved
Copy link

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Some things to consider. View full project report here.

reports/models.py Show resolved Hide resolved
modules/models.py Outdated Show resolved Hide resolved
packages/utils.py Outdated Show resolved Hide resolved
packages/utils.py Outdated Show resolved Hide resolved
repos/utils.py Outdated Show resolved Hide resolved
modules/models.py Show resolved Hide resolved
modules/models.py Show resolved Hide resolved
repos/utils.py Outdated Show resolved Hide resolved
repos/utils.py Outdated Show resolved Hide resolved
repos/utils.py Show resolved Hide resolved
repos/utils.py Show resolved Hide resolved
Copy link

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Looks good. Worth considering though. View full project report here.

reports/models.py Show resolved Hide resolved
modules/models.py Show resolved Hide resolved
modules/models.py Show resolved Hide resolved
modules/views.py Outdated Show resolved Hide resolved
repos/utils.py Outdated Show resolved Hide resolved
repos/utils.py Outdated Show resolved Hide resolved
Copy link

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Looks good. Worth considering though. View full project report here.

modules/models.py Show resolved Hide resolved
modules/models.py Show resolved Hide resolved
reports/models.py Show resolved Hide resolved
repos/utils.py Show resolved Hide resolved
repos/utils.py Show resolved Hide resolved
repos/utils.py Show resolved Hide resolved
@furlongm furlongm changed the title Modularity modularity support May 1, 2023
Copy link

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Some things to consider. View full project report here.

modules/models.py Show resolved Hide resolved
modules/models.py Show resolved Hide resolved
reports/models.py Show resolved Hide resolved
except DatabaseError as e:
error_message.send(sender=None, text=e)
modules.add(module)
for package in module.packages.all():
Copy link

Choose a reason for hiding this comment

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

1% of developers fix this issue

reportUnboundVariable: "module" is possibly unbound


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

modules.add(module)
for package in module.packages.all():
if package.id not in package_ids:
module.packages.remove(package)
Copy link

Choose a reason for hiding this comment

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

1% of developers fix this issue

reportUnboundVariable: "module" is possibly unbound


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

Copy link

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Worth considering. View full project report here.

stream = models.CharField(unique=True, max_length=255)
version = models.CharField(max_length=255)
context = models.CharField(unique=True, max_length=255)
arch = models.ForeignKey(PackageArchitecture, on_delete=models.CASCADE)

Choose a reason for hiding this comment

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

Django automatically creates a related_name if it's not set. If it were set then a more readable and explicit relationship is set up. Explained here.

version = models.CharField(max_length=255)
context = models.CharField(unique=True, max_length=255)
arch = models.ForeignKey(PackageArchitecture, on_delete=models.CASCADE)
repo = models.ForeignKey(Repository, on_delete=models.CASCADE)

Choose a reason for hiding this comment

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

Again, with an explicit related_name would be better.

@@ -45,6 +45,7 @@ class Report(models.Model):
sec_updates = models.TextField(null=True, blank=True)
bug_updates = models.TextField(null=True, blank=True)
repos = models.TextField(null=True, blank=True)
modules = models.TextField(null=True, blank=True)

Choose a reason for hiding this comment

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

Suggested change
modules = models.TextField(null=True, blank=True)
modules = models.TextField(default='', blank=True)

null=True on a string field causes inconsistent data types because the value can be either str or None. This adds complexity and maybe bugs, but can be solved by replacing null=True with default="". More details.

Copy link

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Worth considering. View full project report here.

stream = models.CharField(unique=True, max_length=255)
version = models.CharField(max_length=255)
context = models.CharField(unique=True, max_length=255)
arch = models.ForeignKey(PackageArchitecture, on_delete=models.CASCADE)

Choose a reason for hiding this comment

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

Django automatically creates a related_name if it's not set. If it were set then a more readable and explicit relationship is set up. More info.

version = models.CharField(max_length=255)
context = models.CharField(unique=True, max_length=255)
arch = models.ForeignKey(PackageArchitecture, on_delete=models.CASCADE)
repo = models.ForeignKey(Repository, on_delete=models.CASCADE)

Choose a reason for hiding this comment

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

Likewise, with an explicit related_name would be better.

@@ -45,6 +45,7 @@ class Report(models.Model):
sec_updates = models.TextField(null=True, blank=True)
bug_updates = models.TextField(null=True, blank=True)
repos = models.TextField(null=True, blank=True)
modules = models.TextField(null=True, blank=True)

Choose a reason for hiding this comment

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

Suggested change
modules = models.TextField(null=True, blank=True)
modules = models.TextField(default='', blank=True)

null=True on a string field causes inconsistent data types because the value can be either str or None. This adds complexity and maybe bugs, but can be solved by replacing null=True with default="". More.

@furlongm furlongm merged commit 40569b4 into master Dec 7, 2023
4 checks passed
@furlongm furlongm deleted the modularity branch December 7, 2023 03:31
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