Skip to content

Commit

Permalink
Merge branch '5.0-trunk'
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed May 4, 2023
2 parents c5351b2 + 01eca68 commit da9f042
Show file tree
Hide file tree
Showing 158 changed files with 627 additions and 222 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/github-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ jobs:
docker network create rt
- name: Check out RTIR
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-sqlite
- name: Build test environment
run: |
docker build --build-arg RT_DB_TYPE=SQLite --tag rtir .
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make'
- name: Run RTIR tests
run: |
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make test-parallel'
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && make test-parallel'
- name: Get run time
if: always()
run: |
Expand Down Expand Up @@ -69,13 +76,20 @@ jobs:
docker network create rt
- name: Check out RTIR
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-mariadb
- name: Build test environment
run: |
docker run --detach --name rtdb --network rt --env MYSQL_ROOT_PASSWORD=password mariadb:10.3
docker run --detach --name rtdb --network rt --env MYSQL_ROOT_PASSWORD=password mariadb:10.6
docker build --build-arg RT_DB_TYPE=mysql --build-arg RT_TEST_DB_HOST=rtdb --network rt --tag rtir .
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make'
- name: Run RTIR tests
run: |
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make test-parallel'
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && make test-parallel'
- name: Get run time
if: always()
run: |
Expand All @@ -99,7 +113,7 @@ jobs:
failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
fields: |
[{ "title": "Configuration", "value": "RTIR, MariaDB", "short": true },
[{ "title": "Configuration", "value": "RTIR, MariaDB 10.6", "short": true },
{ "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]
rtir_test_postgresql:
runs-on: ubuntu-latest
Expand All @@ -111,13 +125,20 @@ jobs:
docker network create rt
- name: Check out RTIR
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-pg
- name: Build test environment
run: |
docker run --detach --name rtdb --network rt --mount type=tmpfs,destination=/var/lib/postgresql/data --env POSTGRES_PASSWORD=password postgres:9.6
docker run --detach --name rtdb --network rt --mount type=tmpfs,destination=/var/lib/postgresql/data --env POSTGRES_PASSWORD=password postgres:12.8
docker build --build-arg RT_DB_TYPE=Pg --build-arg RT_DBA_USER=postgres --build-arg RT_TEST_DB_HOST=rtdb --network rt --tag rtir .
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make'
- name: Run RTIR tests
run: |
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make test-parallel'
docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && make test-parallel'
- name: Get run time
if: always()
run: |
Expand All @@ -141,5 +162,5 @@ jobs:
failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
fields: |
[{ "title": "Configuration", "value": "RTIR, PostgreSQL", "short": true },
[{ "title": "Configuration", "value": "RTIR, PostgreSQL 12.8", "short": true },
{ "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bpssysadmin/rt-base-debian-stretch
FROM bpssysadmin/rt-base-debian:RT-5.0.3-buster-20230421

LABEL maintainer="Best Practical Solutions <contact@bestpractical.com>"

Expand All @@ -11,6 +11,8 @@ ARG RT_DBA_PASSWORD=password
ARG RT_TEST_DB_HOST=172.17.0.2
ARG RT_TEST_RT_HOST

ENV PATH="/opt/perl/bin:$PATH"

RUN cd /usr/local/src \
&& git clone https://github.com/bestpractical/rt.git \
&& cd rt \
Expand All @@ -24,10 +26,10 @@ RUN cd /usr/local/src \
--with-db-host="$RT_TEST_DB_HOST" \
--with-db-rt-host="${RT_TEST_RT_HOST:-$(ip --oneline address show to 172.16/12 | gawk '{split($4, a, "/"); print a[1] "/255.255.255.0"; exit 0;}')}" \
&& make install \
&& /usr/bin/perl -I/opt/rt5/local/lib -I/opt/rt5/lib sbin/rt-setup-database --action init --dba="$RT_DBA_USER" --dba-password="$RT_DBA_PASSWORD" \
&& perl -I/opt/rt5/local/lib -I/opt/rt5/lib sbin/rt-setup-database --action init --dba="$RT_DBA_USER" --dba-password="$RT_DBA_PASSWORD" \
&& rm -rf /usr/local/src/*

RUN cpanm Net::Domain::TLD Net::Whois::RIPE Parse::BooleanLogic
RUN cpm install --global --no-prebuilt --test --with-all --show-build-log-on-failure Net::Domain::TLD Net::Whois::RIPE Parse::BooleanLogic

ENV RT_DBA_USER="$RT_DBA_USER"
ENV RT_DBA_PASSWORD="$RT_DBA_PASSWORD"
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ etc/upgrade/3.3.4/content
etc/upgrade/4.9.0/content
etc/upgrade/4.9.1/content
etc/upgrade/5.0.2/content
etc/upgrade/5.0.4/content
etc/upgrade/process_articles_initialdata
etc/upgrade/remove_files
etc/upgrade/rtir-2.4-upgrade.pl.in
html/Callbacks/RTIR/Admin/Queues/DefaultValues.html/Init
Expand Down
4 changes: 2 additions & 2 deletions META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ configure_requires:
ExtUtils::MakeMaker: 6.59
distribution_type: module
dynamic_config: 1
generated_by: 'Module::Install version 1.19'
generated_by: 'Module::Install version 1.21'
license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
Expand All @@ -33,7 +33,7 @@ requires:
perl: 5.10.1
resources:
license: http://opensource.org/licenses/gpl-license.php
version: 5.0.3
version: 5.0.4
x_module_install_rtx_version: '0.43'
x_requires_rt: 5.0.0
x_rt_too_new: 5.2.0
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ To report a bug, send email to rtir-bugs@bestpractical.com.
#
# COPYRIGHT:
#
# This software is Copyright (c) 1996-2022 Best Practical Solutions, LLC
# This software is Copyright (c) 1996-2023 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
Expand Down
2 changes: 1 addition & 1 deletion bin/add_constituency.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# COPYRIGHT:
#
# This software is Copyright (c) 1996-2022 Best Practical Solutions, LLC
# This software is Copyright (c) 1996-2023 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
Expand Down
32 changes: 32 additions & 0 deletions docs/AdministrationTutorial.pod
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,38 @@ Customer for an IR or Investigation.

=back

=head2 Documenting Process for Incidents

Starting in version 5.0.4, RT supports a feature called Process Articles
that allows you to document the process for working on a ticket, and
display it right on the page. The process is managed in an article,
and which article to show is determined by a field on the ticket.

Starting in RTIR 5.0.4 this feature is available for Incidents. The
default Classification field contains values to indicate the type of
the incident. You can set up an article for each of the Classification
values to document how that type of incident should be handled. Once
configured, this documentation will be shown right on the incident page.

The configuration options L<ProcessArticleFields|https://docs.bestpractical.com/rt/latest/RT_Config.html#ProcessArticleFields>
and L<ProcessArticleMapping|https://docs.bestpractical.com/rt/latest/RT_Config.html#ProcessArticleMapping>
set the article class to use and also determine the mapping between
the Classification values and corresponding articles. If you have
added or removed Classification values, you can update this configuration
with your new settings.

Articles are created in a class called Incidents Processes by default,
and members of the DutyTeam group can see and modify these articles. You can
change the rights on the class if you want to restrict who can
update the documentation.

Edit the articles to add your actual process docuemtnation. Note that if
you change the article Name field, you need to update the C<%ProcessArticleMapping>
setting mentioned above because it uses the article name.

This feature is optional and can be disabled by clearing the
configuration options linked above.

=head2 Managing "RT at a glance" and "RTIR at a glance" pages

In the config you can set the C<@RTIR_HomepageComponents> option to control
Expand Down
47 changes: 47 additions & 0 deletions docs/UPGRADING-5.0
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,51 @@ moving the scrip to Batch mode may restore the previous behavior.

=back

=head1 UPGRADING FROM 5.0.3 AND EARLIER

=over 4

=item * Process Articles for Incidents

Starting with RTIR 5.0.4, we include a new portlet on the Incident page
which can show the process to be followed for an Incident based on the
selected Classification.

Default articles for the process documentation are installed in new RTIRs
by default. For an existing RTIR system, you can also add the starter
articles by running the following after your upgrade:

cd /opt/rt5
sbin/rt-setup-database --action insert --datafile local/plugins/RT-IR/etc/upgrade/process_articles_initialdata

=item * Allow DutyTeam to See Templates Articles

This upgrade runs a step to grant the default DutyTeam group rights to
see custom fields in the Templates class. This allows DutyTeam members
to use articles when corresponding on tickets. This right was previously
omitted in error.

If you explicitly do not want DutyTeam to see the articles in the Templates
class, you can edit the class and remove the SeeCustomField right after you
run the upgrade.

=item * "How Reported" no longer defaults to Email

In previous versions of RTIR, L<RT::Action::RTIR_SetHowReported> automatically
set the "How Reported" custom field on Incident Reports to "Email" if no
value was provided. In RTIR 5.0.4 we updated this action to get the value
from RT's L<RT/CurrentInterface> method, so it will automatically be set
to values like "Web" or "REST2" if a ticket is created that way rather than
always "Email".

If you prefer defaulting to "Email", you can disable this scrip and set "Email"
as a default value in the Incident Reports queue configuration.

If you want to see new values set automatically, you can update you values
list for "How Reported" to include these new values:

"API", "CLI", "REST", "REST2", and "Web"

=back

=cut
28 changes: 28 additions & 0 deletions etc/RTIR_Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,34 @@ By default RTIR enables 'httpurl_overwrite', 'ip', 'email' and 'domain'.

Set(@Active_MakeClicky, qw(httpurl_overwrite ip email domain));

=item Process Articles for Incidents
RTIR provides configuration to show process documentation on Incident
pages based on the selected Classification. You can change this behavior
via configuration using the options L<ProcessArticleFields|https://docs.bestpractical.com/rt/latest/RT_Config.html#ProcessArticleFields>
and L<ProcessArticleMapping|https://docs.bestpractical.com/rt/latest/RT_Config.html#ProcessArticleMapping>.
You can see additional information about how to manage Process Articles in
the RT L<Articles|https://docs.bestpractical.com/rt/latest/customizing/articles_introduction.html>
documentation.
=cut

Set( %ProcessArticleFields, (
Incidents => { Field => 'CF.Classification', Class => 'Incidents Processes' },
));

Set(%ProcessArticleMapping, (
'CF.Classification' => {
'Spam' => 'Spam Process',
'System Compromise' => 'System Compromise Process',
'Query' => 'Query Process',
'Scan' => 'Scan Process',
'Denial of Service' => 'Denial of Service Process',
'Piracy' => 'Piracy Process',
},
));

=back
=head1 Custom Fields
Expand Down
Loading

0 comments on commit da9f042

Please sign in to comment.