-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dp): Remove grant attempts (#13394)
Grant attemts have been obsolete since carrier aggregation was introduced. Signed-off-by: Kuba Marciniszyn <kuba@freedomfi.com>
- Loading branch information
Showing
15 changed files
with
233 additions
and
267 deletions.
There are no files selected for viewing
324 changes: 157 additions & 167 deletions
324
dp/cloud/go/active_mode_controller/protos/active_mode/active_mode.pb.go
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
dp/cloud/python/magma/db_service/migrations/versions/016_remove_grant_attempts.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""empty message | ||
Revision ID: 58a1b16ef73c | ||
Revises: 530b18568ad9 | ||
Create Date: 2022-07-22 16:03:01.235285 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '58a1b16ef73c' | ||
down_revision = '530b18568ad9' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
""" | ||
Run upgrade | ||
""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('cbsds', 'grant_attempts') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
""" | ||
Run downgrade | ||
""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('cbsds', sa.Column('grant_attempts', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=False)) | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
dp/cloud/python/magma/db_service/tests/unit/test_016_remove_grant_attempts.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Copyright 2022 The Magma Authors. | ||
This source code is licensed under the BSD-style license found in the | ||
LICENSE file in the root directory of this source tree. | ||
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. | ||
""" | ||
from magma.db_service.tests.alembic_testcase import AlembicTestCase | ||
|
||
TABLE = 'cbsds' | ||
COLUMN = 'grant_attempts' | ||
|
||
|
||
class RemoveGrantAttemptsTestCase(AlembicTestCase): | ||
down_revision = '530b18568ad9' | ||
up_revision = '58a1b16ef73c' | ||
|
||
def setUp(self) -> None: | ||
super().setUp() | ||
self.upgrade(self.down_revision) | ||
|
||
def test_upgrade(self): | ||
self.upgrade() | ||
self.assertFalse(self.has_column(self.get_table(TABLE), COLUMN)) | ||
|
||
def test_columns_present_post_upgrade(self): | ||
self.upgrade() | ||
self.downgrade() | ||
self.assertTrue(self.has_column(self.get_table(TABLE), COLUMN)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters