<commit_before>// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// eslint-disable-next-line node/no-extraneous-import
import {Probot} from 'probot';
import {GCFBootstrapper} from 'gcf-utils';

const bootstrap = new GCFBootstrapper({
  taskTargetEnvironment: 'run',
  taskTargetName: 'owl-bot-backend',
});

// We only need to deploy gcf-utils in the frontend server because only thing
// it does is to enqueue a task for the OwlBot backend. Thus we deploy a dummy
// empty bot code.

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const appFn = (app: Probot) => {};

const server = bootstrap.server(appFn);
const port = process.env.PORT ?? 8080;

server
  .listen(port, () => {
    console.log(`Listening on port ${port}`);
  })
  .setTimeout(0); // Disable automatic timeout on incoming connections.<commit_msg>Revert "build(owl-bot): route traffic to the cloud run backend (#3383)" (#3384)<commit_after>// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// eslint-disable-next-line node/no-extraneous-import
import {Probot} from 'probot';
import {GCFBootstrapper} from 'gcf-utils';

const bootstrap = new GCFBootstrapper({
  taskTargetEnvironment: 'functions',
});

// We only need to deploy gcf-utils in the frontend server because only thing
// it does is to enqueue a task for the OwlBot backend. Thus we deploy a dummy
// empty bot code.

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const appFn = (app: Probot) => {};

const server = bootstrap.server(appFn);
const port = process.env.PORT ?? 8080;

server
  .listen(port, () => {
    console.log(`Listening on port ${port}`);
  })
  .setTimeout(0); // Disable automatic timeout on incoming connections.
{'fraction_non_alphanumeric': 0.11267605633802817, 'fraction_numerical': 0.012278801011195377, 'mean_word_length': 3.759450171821306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4214888', 'n_tokens_mistral': 803, 'n_tokens_neox': 779, 'n_words': 325}