<commit_before>#!/bin/bash

MODULEPATH="$(/usr/bin/puppet config print modulepath | sed -e 's/:.*//')/omegaup"

# Update the Puppet files
(cd "${MODULEPATH}" && git pull --rebase origin master)

# Apply the latest changes.
puppet apply --detailed-exitcodes --disable_warnings=deprecations \
  "${MODULEPATH}/manifests/<%= @manifest_name %>.pp"

exitcode=$?
# From https://puppet.com/docs/puppet/5.3/man/apply.html:
case ${exitcode} in
0|2)
  # 0: The run succeeded with no changes or failures; the system was already in
  #    the desired state.
  # 2: The run succeeded, and some resources were changed.
  ;;
*)
  # 1: The run failed.
  # 4: The run succeeded, and some resources failed.
  # 6: The run succeeded, and included both changes and failures.
  exit ${exitcode}
  ;;
esac
<% if !@force_database_migration_args.empty? %>
# Perform a database migration
(cd /opt/omegaup && \
  ./stuff/db-migrate.py migrate <%= @force_database_migration_args.join(" ") %>)
<% end %>
exit 0
<commit_msg>Replacing the path detection logic for the modulepath<commit_after>#!/bin/bash

MODULEPATH="$(/usr/bin/puppet config print modulepath | sed -e 's/.*://')/omegaup"

# Update the Puppet files
(cd "${MODULEPATH}" && git pull --rebase origin master)

# Apply the latest changes.
puppet apply --detailed-exitcodes --disable_warnings=deprecations \
  "${MODULEPATH}/manifests/<%= @manifest_name %>.pp"

exitcode=$?
# From https://puppet.com/docs/puppet/5.3/man/apply.html:
case ${exitcode} in
0|2)
  # 0: The run succeeded with no changes or failures; the system was already in
  #    the desired state.
  # 2: The run succeeded, and some resources were changed.
  ;;
*)
  # 1: The run failed.
  # 4: The run succeeded, and some resources failed.
  # 6: The run succeeded, and included both changes and failures.
  exit ${exitcode}
  ;;
esac
<% if !@force_database_migration_args.empty? %>
# Perform a database migration
(cd /opt/omegaup && \
  ./stuff/db-migrate.py migrate <%= @force_database_migration_args.join(" ") %>)
<% end %>
exit 0

{'fraction_non_alphanumeric': 0.1458128078817734, 'fraction_numerical': 0.009852216748768473, 'mean_word_length': 3.8822115384615383, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '557', 'n_tokens_mistral': 725, 'n_tokens_neox': 676, 'n_words': 211}