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

gentoo client support #652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

gentoo client support #652

wants to merge 1 commit into from

Conversation

furlongm
Copy link
Owner

@furlongm furlongm commented Feb 7, 2025

No description provided.

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.

@furlongm furlongm force-pushed the gentoo-client-support branch 4 times, most recently from e894daf to c73a5b8 Compare February 7, 2025 18:36
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.

@furlongm furlongm force-pushed the gentoo-client-support branch from c73a5b8 to 4a9a140 Compare February 8, 2025 04:50
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.

@furlongm furlongm force-pushed the gentoo-client-support branch from 4a9a140 to 9160512 Compare February 8, 2025 04:53
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.

@furlongm furlongm force-pushed the gentoo-client-support branch from 9160512 to 90f9408 Compare February 8, 2025 04:56
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.

@furlongm furlongm force-pushed the gentoo-client-support branch from 90f9408 to 51cb45b Compare February 8, 2025 04:56
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.

@furlongm furlongm force-pushed the gentoo-client-support branch from 51cb45b to d3b29a4 Compare February 8, 2025 04:59
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.

@furlongm furlongm force-pushed the gentoo-client-support branch from d3b29a4 to 1efefc9 Compare February 8, 2025 06:11
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.

choices=PACKAGE_TYPES,
blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)

Choose a reason for hiding this comment

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

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="". Read more.

blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)
category = models.ForeignKey(PackageCategory, blank=True, null=True, on_delete=models.SET_NULL)

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. Read more.

name = models.CharField(max_length=255)
version = models.CharField(max_length=255)
epoch = models.CharField(max_length=255, blank=True, null=True)
release = models.CharField(max_length=255, blank=True, null=True)
arch = models.CharField(max_length=255)
packagetype = models.CharField(max_length=1, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, null=True)

Choose a reason for hiding this comment

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

Suggested change
category = models.CharField(max_length=255, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, default='')

Likewise, consider replacing null=True with default="" (and blank=True to pass validation checks).

@furlongm furlongm force-pushed the gentoo-client-support branch from 1efefc9 to 3264e62 Compare February 8, 2025 06:15
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.

choices=PACKAGE_TYPES,
blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)

Choose a reason for hiding this comment

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

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.

blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)
category = models.ForeignKey(PackageCategory, blank=True, null=True, on_delete=models.SET_NULL)

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.

name = models.CharField(max_length=255)
version = models.CharField(max_length=255)
epoch = models.CharField(max_length=255, blank=True, null=True)
release = models.CharField(max_length=255, blank=True, null=True)
arch = models.CharField(max_length=255)
packagetype = models.CharField(max_length=1, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, null=True)

Choose a reason for hiding this comment

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

Suggested change
category = models.CharField(max_length=255, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, default='')

Similarly, consider replacing null=True with default="" (and blank=True to pass validation checks).

@furlongm furlongm force-pushed the gentoo-client-support branch from 3264e62 to 9493ca8 Compare February 8, 2025 20:09
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.

choices=PACKAGE_TYPES,
blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)

Choose a reason for hiding this comment

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

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.

blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)
category = models.ForeignKey(PackageCategory, blank=True, null=True, on_delete=models.SET_NULL)

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.

name = models.CharField(max_length=255)
version = models.CharField(max_length=255)
epoch = models.CharField(max_length=255, blank=True, null=True)
release = models.CharField(max_length=255, blank=True, null=True)
arch = models.CharField(max_length=255)
packagetype = models.CharField(max_length=1, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, null=True)

Choose a reason for hiding this comment

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

Suggested change
category = models.CharField(max_length=255, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, default='')

As above, consider replacing null=True with default="" (and blank=True to pass validation checks).

reports/utils.py Outdated
with transaction.atomic():
repo_arch, created = machine_arches.get_or_create(name='any')

repo_name = f'Gentoo Linux'

Choose a reason for hiding this comment

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

Suggested change
repo_name = f'Gentoo Linux'
repo_name = 'Gentoo Linux'

f-string is unnecessary here. This can just be a string. Read more.

@furlongm furlongm force-pushed the gentoo-client-support branch from 9493ca8 to a133181 Compare February 8, 2025 20:27
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.

choices=PACKAGE_TYPES,
blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)

Choose a reason for hiding this comment

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

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 info.

blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)
category = models.ForeignKey(PackageCategory, blank=True, null=True, on_delete=models.SET_NULL)

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.

name = models.CharField(max_length=255)
version = models.CharField(max_length=255)
epoch = models.CharField(max_length=255, blank=True, null=True)
release = models.CharField(max_length=255, blank=True, null=True)
arch = models.CharField(max_length=255)
packagetype = models.CharField(max_length=1, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, null=True)

Choose a reason for hiding this comment

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

Suggested change
category = models.CharField(max_length=255, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, default='')

Likewise, consider replacing null=True with default="" (and blank=True to pass validation checks).

@furlongm furlongm force-pushed the gentoo-client-support branch from a133181 to 4a2c475 Compare February 8, 2025 20:30
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.

choices=PACKAGE_TYPES,
blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)

Choose a reason for hiding this comment

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

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="". Explained here.

blank=True,
null=True)
packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True)
category = models.ForeignKey(PackageCategory, blank=True, null=True, on_delete=models.SET_NULL)

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 details.

name = models.CharField(max_length=255)
version = models.CharField(max_length=255)
epoch = models.CharField(max_length=255, blank=True, null=True)
release = models.CharField(max_length=255, blank=True, null=True)
arch = models.CharField(max_length=255)
packagetype = models.CharField(max_length=1, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, null=True)

Choose a reason for hiding this comment

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

Suggested change
category = models.CharField(max_length=255, blank=True, null=True)
category = models.CharField(max_length=255, blank=True, default='')

Again, consider replacing null=True with default="" (and blank=True to pass validation checks).

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