Skip to content

Commit

Permalink
Merge pull request #18064 from netbox-community/develop
Browse files Browse the repository at this point in the history
Release v4.1.7
  • Loading branch information
jeremystretch authored Nov 21, 2024
2 parents 58bc388 + 3b3990a commit 9c7f2ec
Show file tree
Hide file tree
Showing 65 changed files with 10,147 additions and 10,251 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/01-feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
attributes:
label: NetBox version
description: What version of NetBox are you currently running?
placeholder: v4.1.6
placeholder: v4.1.7
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/02-bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ body:
attributes:
label: NetBox Version
description: What version of NetBox are you currently running?
placeholder: v4.1.6
placeholder: v4.1.7
validations:
required: true
- type: dropdown
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
permissions:
contents: read

# Add concurrency group to control job running
concurrency:
group: ${{ github.event_name }}-${{ github.ref }}-${{ github.actor }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
12 changes: 12 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[main]
host = https://app.transifex.com

[o:netbox-community:p:netbox:r:9cbf4fcf95b3d92e4ebbf1a5e5d1caee]
file_filter = netbox/translations/<lang>/LC_MESSAGES/django.po
source_file = netbox/translations/en/LC_MESSAGES/django.po
type = PO
minimum_perc = 0
resource_name = django.po
replace_edited_strings = false
keep_translations = false

4 changes: 2 additions & 2 deletions base_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ django-rich

# Django integration for RQ (Reqis queuing)
# https://github.com/rq/django-rq/blob/master/CHANGELOG.md
django-rq<3.0
django-rq

# Abstraction models for rendering and paginating HTML tables
# https://github.com/jieter/django-tables2/blob/master/CHANGELOG.md
Expand Down Expand Up @@ -118,7 +118,7 @@ requests

# rq
# https://github.com/rq/rq/blob/master/CHANGES.md
rq<2.0
rq

# Social authentication framework
# https://github.com/python-social-auth/social-core/blob/master/CHANGELOG.md
Expand Down
1 change: 1 addition & 0 deletions contrib/generated_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@
"100base-tx",
"100base-t1",
"1000base-t",
"1000base-lx",
"1000base-tx",
"2.5gbase-t",
"5gbase-t",
Expand Down
15 changes: 14 additions & 1 deletion docs/development/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,20 @@ This will automatically update the schema file at `contrib/generated_schema.json

### Update & Compile Translations

Updated language translations should be pulled from [Transifex](https://app.transifex.com/netbox-community/netbox/dashboard/) and re-compiled for each new release. Follow the documented process for [updating translated strings](./translations.md#updating-translated-strings) to do this.
Updated language translations should be pulled from [Transifex](https://app.transifex.com/netbox-community/netbox/dashboard/) and re-compiled for each new release. First, retrieve any updated translation files using the Transifex CLI client:

```no-highlight
tx pull
```

Then, compile these portable (`.po`) files for use in the application:

```no-highlight
./manage.py compilemessages
```

!!! tip
Consult the translation documentation for more detail on [updating translated strings](./translations.md#updating-translated-strings) if you've not set up the Transifex client already.

### Update Version and Changelog

Expand Down
21 changes: 13 additions & 8 deletions docs/development/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,31 @@ To update the English `.po` file from which all translations are derived, use th

Then, commit the change and push to the `develop` branch on GitHub. Any new strings will appear for translation on Transifex automatically.

!!! note
It is typically not necessary to update source strings manually, as this is done nightly by a [GitHub action](https://github.com/netbox-community/netbox/blob/develop/.github/workflows/update-translation-strings.yml).

## Updating Translated Strings

Typically, translated strings need to be updated only as part of the NetBox [release process](./release-checklist.md).

Check the Transifex dashboard for languages that are not marked _ready for use_, being sure to click _Show all languages_ if it appears at the bottom of the list. Use machine translation to round out any not-ready languages. It's not necessary to review the machine translation immediately as the translation teams will handle that aspect; the goal at this stage is to get translations included in the Transifex pull request.

To update translated strings, start by initiating a sync from Transifex. From the Transifex dashboard, navigate to Settings > Integrations > GitHub > Manage, and click the **Manual Sync** button at top right.
To download translated strings automatically, you'll need to:

![Transifex manual sync](../media/development/transifex_sync.png)
1. Install the [Transifex CLI client](https://github.com/transifex/cli)
2. Generate a [Transifex API token](https://app.transifex.com/user/settings/api/)

Enter a threshold percentage of 1 (to ensure all translations are captured) and select the `develop` branch, then click **Sync**. This will initiate a pull request to GitHub to update any newly modified translation (`.po`) files.
Once you have the client set up, run the following command:

!!! tip
The new PR should appear within a few minutes. If it does not, check that there are in fact new translations to be added.
```no-highlight
TX_TOKEN=$TOKEN tx pull
```

![Transifex pull request](../media/development/transifex_pull_request.png)
This will download all portable (`.po`) translation files from Transifex, updating them locally as needed.

Once the PR has been merged, the updated strings need to be compiled into new `.mo` files so they can be used by the application. Update the `develop` branch locally to pull in the changes from the Transifex PR, then run Django's [`compilemessages`](https://docs.djangoproject.com/en/stable/ref/django-admin/#django-admin-compilemessages) management command:
Once retrieved, the updated strings need to be compiled into new `.mo` files so they can be used by the application. Run Django's [`compilemessages`](https://docs.djangoproject.com/en/stable/ref/django-admin/#django-admin-compilemessages) management command to compile them:

```nohighlight
```no-highlight
./manage.py compilemessages
```

Expand Down
Binary file removed docs/media/development/transifex_pull_request.png
Binary file not shown.
Binary file removed docs/media/development/transifex_sync.png
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/models/vpn/ikepolicy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IKE Policies

An [Internet Key Exhcnage (IKE)](https://en.wikipedia.org/wiki/Internet_Key_Exchange) policy defines an IKE version, mode, and set of [proposals](./ikeproposal.md) to be used in IKE negotiation. These policies are referenced by [IPSec profiles](./ipsecprofile.md).
An [Internet Key Exchange (IKE)](https://en.wikipedia.org/wiki/Internet_Key_Exchange) policy defines an IKE version, mode, and set of [proposals](./ikeproposal.md) to be used in IKE negotiation. These policies are referenced by [IPSec profiles](./ipsecprofile.md).

## Fields

Expand Down
24 changes: 24 additions & 0 deletions docs/release-notes/version-4.1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# NetBox v4.1

## v4.1.7 (FUTURE)

### Enhancements

* [#15239](https://github.com/netbox-community/netbox/issues/15239) - Enable adding/removing individual VLANs while bulk editing device interfaces
* [#17871](https://github.com/netbox-community/netbox/issues/17871) - Enable the assignment/removal of virtualization cluster via device bulk edit
* [#17934](https://github.com/netbox-community/netbox/issues/17934) - Add 1000Base-LX interface type
* [#18007](https://github.com/netbox-community/netbox/issues/18007) - Hide sensitive parameters under data source view (even for privileged users)

### Bug Fixes

* [#17459](https://github.com/netbox-community/netbox/issues/17459) - Correct help text on `name` field of module type component templates
* [#17901](https://github.com/netbox-community/netbox/issues/17901) - Ensure GraphiQL UI resources are served locally
* [#17921](https://github.com/netbox-community/netbox/issues/17921) - Fix scheduling of recurring custom scripts
* [#17923](https://github.com/netbox-community/netbox/issues/17923) - Fix the execution of custom scripts via REST API & management command
* [#17963](https://github.com/netbox-community/netbox/issues/17963) - Fix selection of all listed objects during bulk edit
* [#17969](https://github.com/netbox-community/netbox/issues/17969) - Fix system info export when a config revision exists
* [#17972](https://github.com/netbox-community/netbox/issues/17972) - Force evaluation of `LOGIN_REQUIRED` when requesting static media
* [#17986](https://github.com/netbox-community/netbox/issues/17986) - Correct labels for virtual machine & virtual disk size properties
* [#18037](https://github.com/netbox-community/netbox/issues/18037) - Fix validation of maximum VLAN ID value when defining VLAN groups
* [#18038](https://github.com/netbox-community/netbox/issues/18038) - The `to_grams()` utility function should always return an integer value

---

## v4.1.6 (2024-10-31)

### Bug Fixes
Expand Down
7 changes: 6 additions & 1 deletion netbox/core/models/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import gettext as _
from rq.exceptions import InvalidJobOperation

from core.choices import JobStatusChoices
from core.models import ObjectType
Expand Down Expand Up @@ -158,7 +159,11 @@ def delete(self, *args, **kwargs):
job = queue.fetch_job(str(self.job_id))

if job:
job.cancel()
try:
job.cancel()
except InvalidJobOperation:
# Job may raise this exception from get_status() if missing from Redis
pass

def start(self):
"""
Expand Down
30 changes: 30 additions & 0 deletions netbox/core/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def test_background_task_stop(self):
worker = get_worker('default')
job = queue.enqueue(self.dummy_job_default)
worker.prepare_job_execution(job)
worker.prepare_execution(job)

self.assertEqual(job.get_status(), JobStatus.STARTED)

Expand Down Expand Up @@ -345,3 +346,32 @@ def test_worker(self):
self.assertIn(str(worker1.name), str(response.content))
self.assertIn('Birth', str(response.content))
self.assertIn('Total working time', str(response.content))


class SystemTestCase(TestCase):

def setUp(self):
super().setUp()

self.user.is_staff = True
self.user.save()

def test_system_view_default(self):
# Test UI render
response = self.client.get(reverse('core:system'))
self.assertEqual(response.status_code, 200)

# Test export
response = self.client.get(f"{reverse('core:system')}?export=true")
self.assertEqual(response.status_code, 200)

def test_system_view_with_config_revision(self):
ConfigRevision.objects.create()

# Test UI render
response = self.client.get(reverse('core:system'))
self.assertEqual(response.status_code, 200)

# Test export
response = self.client.get(f"{reverse('core:system')}?export=true")
self.assertEqual(response.status_code, 200)
6 changes: 1 addition & 5 deletions netbox/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,11 +626,7 @@ def get(self, request):
}

# Configuration
try:
config = ConfigRevision.objects.get(pk=cache.get('config_version'))
except ConfigRevision.DoesNotExist:
# Fall back to using the active config data if no record is found
config = get_config()
config = get_config()

# Raw data export
if 'export' in request.GET:
Expand Down
2 changes: 2 additions & 0 deletions netbox/dcim/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ class InterfaceTypeChoices(ChoiceSet):
TYPE_100ME_T1 = '100base-t1'
TYPE_100ME_SFP = '100base-x-sfp'
TYPE_1GE_FIXED = '1000base-t'
TYPE_1GE_LX_FIXED = '1000base-lx'
TYPE_1GE_TX_FIXED = '1000base-tx'
TYPE_1GE_GBIC = '1000base-x-gbic'
TYPE_1GE_SFP = '1000base-x-sfp'
Expand Down Expand Up @@ -1033,6 +1034,7 @@ class InterfaceTypeChoices(ChoiceSet):
(TYPE_100ME_FIXED, '100BASE-TX (10/100ME)'),
(TYPE_100ME_T1, '100BASE-T1 (10/100ME Single Pair)'),
(TYPE_1GE_FIXED, '1000BASE-T (1GE)'),
(TYPE_1GE_LX_FIXED, '1000BASE-LX (1GE)'),
(TYPE_1GE_TX_FIXED, '1000BASE-TX (1GE)'),
(TYPE_2GE_FIXED, '2.5GBASE-T (2.5GE)'),
(TYPE_5GE_FIXED, '5GBASE-T (5GE)'),
Expand Down
Loading

0 comments on commit 9c7f2ec

Please sign in to comment.