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

Bump setuptools from 41.6.0 to 54.1.2 in /requirements #3

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions awx/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,8 @@ class ProjectOptionsSerializer(BaseSerializer):

class Meta:
fields = ('*', 'local_path', 'scm_type', 'scm_url', 'scm_branch', 'scm_refspec',
'scm_clean', 'scm_delete_on_update', 'credential', 'timeout', 'scm_revision')
'scm_clean', 'scm_track_submodules', 'scm_delete_on_update', 'credential',
'timeout', 'scm_revision')

def get_related(self, obj):
res = super(ProjectOptionsSerializer, self).get_related(obj)
Expand Down Expand Up @@ -1462,7 +1463,7 @@ def get_field_from_model_or_attrs(fd):
)})

if get_field_from_model_or_attrs('scm_type') == '':
for fd in ('scm_update_on_launch', 'scm_delete_on_update', 'scm_clean'):
for fd in ('scm_update_on_launch', 'scm_delete_on_update', 'scm_track_submodules', 'scm_clean'):
if get_field_from_model_or_attrs(fd):
raise serializers.ValidationError({fd: _('Update options must be set to false for manual projects.')})
return super(ProjectSerializer, self).validate(attrs)
Expand Down
33 changes: 33 additions & 0 deletions awx/main/migrations/0132_scm_track_submodules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 2.2.16 on 2021-02-02 14:41

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('main', '0131_undo_org_polymorphic_ee'),
]

operations = [
migrations.AddField(
model_name='Project',
name='scm_track_submodules',
field=models.BooleanField(help_text='Track submodule latest commit on specified branch.'),
),
migrations.AddField(
model_name='ProjectUpdate',
name='scm_track_submodules',
field=models.BooleanField(help_text='Track submodule latest commit on specified branch.'),
),
migrations.AlterField(
model_name='project',
name='scm_track_submodules',
field=models.BooleanField(default=False, help_text='Track submodules latest commits on defined branch.'),
),
migrations.AlterField(
model_name='projectupdate',
name='scm_track_submodules',
field=models.BooleanField(default=False, help_text='Track submodules latest commits on defined branch.'),
),
]
4 changes: 4 additions & 0 deletions awx/main/models/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ def get_local_path_choices(cls):
default=False,
help_text=_('Delete the project before syncing.'),
)
scm_track_submodules = models.BooleanField(
default=False,
help_text=_('Track submodules latest commits on defined branch.'),
)
credential = models.ForeignKey(
'Credential',
related_name='%(class)ss',
Expand Down
1 change: 1 addition & 0 deletions awx/main/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,7 @@ def build_extra_vars_file(self, project_update, private_data_dir):
'scm_url': scm_url,
'scm_branch': scm_branch,
'scm_clean': project_update.scm_clean,
'scm_track_submodules': project_update.scm_track_submodules,
'roles_enabled': galaxy_creds_are_defined and settings.AWX_ROLES_ENABLED,
'collections_enabled': galaxy_creds_are_defined and settings.AWX_COLLECTIONS_ENABLED,
})
Expand Down
2 changes: 2 additions & 0 deletions awx/playbooks/project_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# scm_password: password (only for svn/insights)
# scm_accept_hostkey: true/false (only for git, set automatically)
# scm_refspec: a refspec to fetch in addition to obtaining version
# scm_track_submodules: true/false
# roles_enabled: Value of the global setting to enable roles downloading
# collections_enabled: Value of the global setting to enable collections downloading
# awx_version: Current running version of the awx or tower as a string
Expand All @@ -36,6 +37,7 @@
version: "{{scm_branch|quote}}"
refspec: "{{scm_refspec|default(omit)}}"
force: "{{scm_clean}}"
track_submodules: "{{scm_track_submodules|default(omit)}}"
accept_hostkey: "{{scm_accept_hostkey|default(omit)}}"
register: git_result

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function PromptProjectDetail({ i18n, resource }) {
scm_branch,
scm_clean,
scm_delete_on_update,
scm_track_submodules,
scm_refspec,
scm_type,
scm_update_on_launch,
Expand All @@ -29,6 +30,7 @@ function PromptProjectDetail({ i18n, resource }) {
if (
scm_clean ||
scm_delete_on_update ||
scm_track_submodules ||
scm_update_on_launch ||
allow_override
) {
Expand All @@ -38,6 +40,11 @@ function PromptProjectDetail({ i18n, resource }) {
{scm_delete_on_update && (
<ListItem>{i18n._(t`Delete on Update`)}</ListItem>
)}
{scm_track_submodules && (
<ListItem>
{i18n._(t`Track submodules latest commit on branch`)}
</ListItem>
)}
{scm_update_on_launch && (
<ListItem>{i18n._(t`Update Revision on Launch`)}</ListItem>
)}
Expand Down
3 changes: 2 additions & 1 deletion awx/ui_next/src/components/PromptDetail/data.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"scm_refspec":"refs/",
"scm_clean":true,
"scm_delete_on_update":true,
"scm_track_submodules":false,
"credential":9,
"timeout":0,
"scm_revision":"",
Expand All @@ -104,4 +105,4 @@
"custom_virtualenv": "mock virtual env",
"last_update_failed":false,
"last_updated":"2020-03-11T20:18:14Z"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('<ProjectAdd />', () => {
scm_type: 'git',
scm_url: 'https://foo.bar',
scm_clean: true,
scm_track_submodules: false,
credential: 100,
local_path: '',
organization: { id: 2, name: 'Bar' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function ProjectDetail({ project, i18n }) {
scm_branch,
scm_clean,
scm_delete_on_update,
scm_track_submodules,
scm_refspec,
scm_type,
scm_update_on_launch,
Expand All @@ -56,6 +57,7 @@ function ProjectDetail({ project, i18n }) {
if (
scm_clean ||
scm_delete_on_update ||
scm_track_submodules ||
scm_update_on_launch ||
allow_override
) {
Expand All @@ -65,6 +67,11 @@ function ProjectDetail({ project, i18n }) {
{scm_delete_on_update && (
<ListItem>{i18n._(t`Delete on Update`)}</ListItem>
)}
{scm_track_submodules && (
<ListItem>
{i18n._(t`Track submodules latest commit on branch`)}
</ListItem>
)}
{scm_update_on_launch && (
<ListItem>{i18n._(t`Update Revision on Launch`)}</ListItem>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe('<ProjectDetail />', () => {
scm_refspec: 'refs/remotes/*',
scm_clean: true,
scm_delete_on_update: true,
scm_track_submodules: false,
credential: 100,
status: 'successful',
organization: 10,
Expand Down Expand Up @@ -132,6 +133,7 @@ describe('<ProjectDetail />', () => {
scm_type: '',
scm_clean: false,
scm_delete_on_update: false,
scm_track_submodules: false,
scm_update_on_launch: false,
allow_override: false,
created: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe('<ProjectEdit />', () => {
scm_type: 'git',
scm_url: 'https://foo.bar',
scm_clean: true,
scm_track_submodules: false,
credential: 100,
local_path: 'bar',
organization: 2,
Expand Down
3 changes: 2 additions & 1 deletion awx/ui_next/src/screens/Project/data.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"scm_refspec": "",
"scm_clean": false,
"scm_delete_on_update": false,
"scm_track_submodules": false,
"credential": null,
"timeout": 0,
"scm_revision": "f5de82382e756b87143f3511c7c6c006d941830d",
Expand All @@ -112,4 +113,4 @@
"custom_virtualenv": null,
"last_update_failed": false,
"last_updated": "2019-09-30T18:06:34.713654Z"
}
}
3 changes: 3 additions & 0 deletions awx/ui_next/src/screens/Project/shared/ProjectForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function ProjectFormFields({
credential: '',
scm_clean: false,
scm_delete_on_update: false,
scm_track_submodules: false,
scm_update_on_launch: false,
allow_override: false,
scm_update_cache_timeout: 0,
Expand Down Expand Up @@ -345,6 +346,7 @@ function ProjectForm({ i18n, project, submitError, ...props }) {
credential: '',
scm_clean: false,
scm_delete_on_update: false,
scm_track_submodules: false,
scm_update_on_launch: false,
allow_override: false,
scm_update_cache_timeout: 0,
Expand Down Expand Up @@ -405,6 +407,7 @@ function ProjectForm({ i18n, project, submitError, ...props }) {
scm_branch: project.scm_branch || '',
scm_clean: project.scm_clean || false,
scm_delete_on_update: project.scm_delete_on_update || false,
scm_track_submodules: project.scm_track_submodules || false,
scm_refspec: project.scm_refspec || '',
scm_type:
project.scm_type === ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('<ProjectForm />', () => {
scm_type: 'git',
scm_url: 'https://foo.bar',
scm_clean: true,
scm_track_submodules: false,
credential: 100,
organization: 2,
scm_update_on_launch: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ export const ScmTypeOptions = withI18n()(
of time required to complete an update.`
)}
/>
<CheckboxField
id="option-scm-track-submodules"
name="scm_track_submodules"
label={i18n._(t`Track submodules`)}
tooltip={i18n._(
t`if yes, submodules will track the latest commit on
their master branch (or other branch specified in
.gitmodules). If no, submodules will be kept at
the revision specified by the main project.
This is equivalent to specifying the --remote
flag to git submodule update.`
)}
/>
<CheckboxField
id="option-scm-update-on-launch"
name="scm_update_on_launch"
Expand Down
1 change: 1 addition & 0 deletions awx/ui_next/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const Project = shape({
scm_refspec: string,
scm_clean: bool,
scm_delete_on_update: bool,
scm_track_submodules: bool,
credential: number,
status: oneOf([
'new',
Expand Down
20 changes: 17 additions & 3 deletions awx_collection/plugins/modules/tower_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
- Remove the repository completely before updating.
type: bool
default: 'no'
scm_track_submodules:
description:
- Track submodules latest commit on specified branch.
type: bool
default: 'no'
scm_update_on_launch:
description:
- Before an update to the local repository before launching a job with this project.
Expand Down Expand Up @@ -249,6 +254,7 @@ def main():
credential=dict(aliases=['scm_credential']),
scm_clean=dict(type='bool', default=False),
scm_delete_on_update=dict(type='bool', default=False),
scm_track_submodules=dict(type='bool', default=False),
scm_update_on_launch=dict(type='bool', default=False),
scm_update_cache_timeout=dict(type='int', default=0),
allow_override=dict(type='bool', aliases=['scm_allow_override']),
Expand Down Expand Up @@ -341,9 +347,17 @@ def main():
}

for field_name in (
'scm_url', 'scm_branch', 'scm_refspec', 'scm_clean', 'scm_delete_on_update',
'timeout', 'scm_update_cache_timeout', 'custom_virtualenv',
'description', 'allow_override',
"scm_url",
"scm_branch",
"scm_refspec",
"scm_clean",
"scm_delete_on_update",
"scm_track_submodules",
"timeout",
"scm_update_cache_timeout",
"custom_virtualenv",
"description",
"allow_override",
):
field_val = module.params.get(field_name)
if field_val is not None:
Expand Down
1 change: 1 addition & 0 deletions awxkit/awxkit/api/pages/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def payload(self, organization, scm_type='git', **kwargs):
'local_path',
'scm_clean',
'scm_delete_on_update',
'scm_track_submodules',
'scm_update_cache_timeout',
'scm_update_on_launch',
'scm_refspec',
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ twisted[tls]>=20.3.0 # CVE-2020-10108, CVE-2020-10109
uWSGI
uwsgitop
pip==19.3.1 # see UPGRADE BLOCKERs
setuptools==41.6.0 # see UPGRADE BLOCKERs
setuptools==54.1.2 # see UPGRADE BLOCKERs
Loading