Skip to content

Commit 44e99b1

Browse files
authored
[CLI] Butler commands TBI (#5032)
This PR adds the `butler.py` commands to the `casp` CLI, but leaves it marked as "To be implemented". These changes are intended to serve as a roadmap for further implementation. Since the commands in `butler.py` need to be validated before migrating to the new CLI, it's crucial to establish a structure and expectations around which commands should be included in `casp`. This will serve as a reminder that these commands should be incorporated into the CLI. Those commands are: - [ ] bootstrap - [ ] py_unittest - [ ] js_unittest - [ ] format - [ ] lint - [ ] package - [ ] deploy - [ ] run_server - [ ] run - [ ] run_bot - [ ] remote - [ ] clean_indexes - [ ] create_config - [ ] integration_tests - [ ] weights - [x] reproduce
1 parent fc61342 commit 44e99b1

File tree

16 files changed

+374
-6
lines changed

16 files changed

+374
-6
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Bootstrap command."""
15+
16+
import click
17+
18+
19+
@click.command(
20+
name='bootstrap',
21+
help=('Install all required dependencies for running an appengine, a bot,'
22+
'and a mapreduce locally.'))
23+
def cli():
24+
"""Install all required dependencies for running an appengine, a bot,
25+
and a mapreduce locally."""
26+
click.echo('To be implemented...')
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Clean indexes command."""
15+
16+
import click
17+
18+
19+
@click.command(
20+
name='clean_indexes', help='Clean up undefined indexes (in index.yaml).')
21+
def cli():
22+
"""Clean up undefined indexes (in index.yaml)."""
23+
click.echo('To be implemented...')
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Create config command."""
15+
16+
import click
17+
18+
19+
@click.command(name='create_config', help='Create a new deployment config.')
20+
def cli():
21+
"""Create a new deployment config."""
22+
click.echo('To be implemented...')
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Deploy command."""
15+
16+
import click
17+
18+
19+
@click.command(name='deploy', help='Deploy to Appengine')
20+
def cli():
21+
"""Deploy to Appengine"""
22+
click.echo('To be implemented...')
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Format command."""
15+
16+
import click
17+
18+
19+
@click.command(name='format', help='Format changed code in current branch.')
20+
def cli():
21+
"""Format changed code in current branch."""
22+
click.echo('To be implemented...')
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Integration tests command."""
15+
16+
import click
17+
18+
19+
@click.command(
20+
name='integration_tests', help='Run end-to-end integration tests.')
21+
def cli():
22+
"""Run end-to-end integration tests."""
23+
click.echo('To be implemented...')
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Js unittest command."""
15+
16+
import click
17+
18+
19+
@click.command(name='js_unittest', help='Run Javascript unit tests.')
20+
def cli():
21+
"""Run Javascript unit tests."""
22+
click.echo('To be implemented...')

cli/casp/src/casp/commands/lint.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Lint command."""
15+
16+
import click
17+
18+
19+
@click.command(name='lint', help='Lint changed code in current branch.')
20+
def cli():
21+
"""Lint changed code in current branch."""
22+
click.echo('To be implemented...')
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Package command."""
15+
16+
import click
17+
18+
19+
@click.command(
20+
name='package', help='Package clusterfuzz with a staging revision')
21+
def cli():
22+
"""Package clusterfuzz with a staging revision"""
23+
click.echo('To be implemented...')
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Py unittest command."""
15+
16+
import click
17+
18+
19+
@click.command(name='py_unittest', help='Run Python unit tests.')
20+
def cli():
21+
"""Run Python unit tests."""
22+
click.echo('To be implemented...')

0 commit comments

Comments
 (0)