Skip to content

Commit

Permalink
Merge pull request #26 from abema/delete-description
Browse files Browse the repository at this point in the history
Delete description param
  • Loading branch information
momomomo111 authored Jun 20, 2023
2 parents 8073d49 + 33b20fe commit 2927ee8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 39 deletions.
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ allprojects {
```groovy
dependencies {
// Flagfit
implementation 'com.github.abema.flagfit:flagfit:1.1.0'
implementation 'com.github.abema.flagfit:flagfit:1.1.1'
// Flagfit flagtype
implementation 'com.github.abema.flagfit:flagfit-flagtype:1.1.0'
implementation 'com.github.abema.flagfit:flagfit-flagtype:1.1.1'
// Flagfit lint
lintChecks 'com.github.abema.flagfit:flagfit-lint:1.1.0'
lintChecks 'com.github.abema.flagfit:flagfit-lint:1.1.1'
}
```

Expand All @@ -53,7 +53,6 @@ interface FlagService {
)
@FlagType.Experiment(
owner = "{GitHub UserId}",
description = "The flag for this is FeatureFlag for awesome features!",
// If the flag expires, the lint will warn you.
expiryDate = "2023-06-13"
)
Expand Down Expand Up @@ -368,7 +367,7 @@ We develop by switching these flags.
We use the `@WorkInProgress` as Release Toggles when we first start development.
If the flag using this `@FlagType.WorkInProgress` is used properly, even if the feature is released, **the false value will be used fixedly**, so the function will not be released by mistake.

When using FlagType, please set `owner`, `description` and `expiryDate`. [Please see section](./README.md#Lint-check-based-on-expiration-date)
When using FlagType, please set `owner` and `expiryDate`. [Please see section](./README.md#Lint-check-based-on-expiration-date)

```kotlin
@BooleanFlag(
Expand All @@ -377,7 +376,6 @@ When using FlagType, please set `owner`, `description` and `expiryDate`. [Please
)
@FlagType.WorkInProgress(
owner = "{GitHub UserId}",
description = "The flag for this is FeatureFlag for awesome features!",
expiryDate = "2023-06-13"
)
fun awesomeFeatureEnabled(): Boolean
Expand All @@ -393,7 +391,6 @@ So we use `@FlagType.Experiment`. With it, you can use any flag management tool,
)
@FlagType.Experiment(
owner = "{GitHub UserId}",
description = "The flag for this is FeatureFlag for awesome features!",
expiryDate = "2023-06-13"
)
fun awesomeFeatureEnabled(): Boolean
Expand All @@ -411,15 +408,13 @@ Since `@FlagType.Ops` and `@FlagType.Permission` may be operated indefinitely, t
)
@FlagType.Ops(
owner = "{GitHub UserId}",
description = "The flag for this is FeatureFlag for awesome features!"
)
fun awesomeFeatureEnabled(): Boolean
```

There may be cases where you do not know the owner or do not want to intentionally generate an error due to not setting a property. In such cases, please set the value as follows

```kotlin
import tv.abema.flagfit.FlagfitDeprecatedParams.DESCRIPTION_NOT_DEFINED
import tv.abema.flagfit.FlagfitDeprecatedParams.EXPIRY_DATE_NOT_DEFINED
import tv.abema.flagfit.FlagfitDeprecatedParams.OWNER_NOT_DEFINED

Expand All @@ -429,7 +424,6 @@ import tv.abema.flagfit.FlagfitDeprecatedParams.OWNER_NOT_DEFINED
)
@FlagType.WorkInProgress(
owner = OWNER_NOT_DEFINED,
description = DESCRIPTION_NOT_DEFINED,
expiryDate = EXPIRY_DATE_NOT_DEFINED
)
fun awesomeUnknownFeatureEnabled(): Boolean
Expand Down Expand Up @@ -470,8 +464,8 @@ val flagfit = Flagfit(
Flags that have passed their expiration date or are scheduled to expire within the next 7 days will be displayed as warnings in the IDE.
| Explanation | Image |
|-----|-----|
|When the flag is about to expire|<img width="791" alt="soon" src="https://github.com/abema/flagfit/assets/51113946/8e2d47d1-1c2f-4d9d-a24c-f8481fd4d529">|
|When the flag has expired|<img width="632" alt="expired" src="https://github.com/abema/flagfit/assets/51113946/06d561ca-b650-4274-a077-a092cad0add8">|
|When the flag is about to expire|<img width="799" alt="soon" src="https://github.com/abema/flagfit/assets/51113946/7fc78bd3-54ba-44c5-9433-9531563b1388">|
|When the flag has expired|<img width="687" alt="expired" src="https://github.com/abema/flagfit/assets/51113946/804e49b8-1555-413e-9455-f6bf21b6e622">|


### Automatic issue creation via workflow
Expand Down
4 changes: 0 additions & 4 deletions flagfit-flagtype/src/main/java/tv/abema/flagfit/FlagType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class FlagType {
*/
annotation class WorkInProgress(
val owner: String,
val description: String,
val expiryDate: String,
)

Expand All @@ -21,7 +20,6 @@ class FlagType {
*/
annotation class Experiment(
val owner: String,
val description: String,
val expiryDate: String,
)

Expand All @@ -32,7 +30,6 @@ class FlagType {
*/
annotation class Ops(
val owner: String,
val description: String,
val expiryDate: String = "",
)

Expand All @@ -43,7 +40,6 @@ class FlagType {
*/
annotation class Permission(
val owner: String,
val description: String,
val expiryDate: String = "",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ object FlagfitDeprecatedParams {
@Deprecated("Flag with no assigned owner")
const val OWNER_NOT_DEFINED = "OWNER_NOT_DEFINED"

@Deprecated("Flag without a description")
const val DESCRIPTION_NOT_DEFINED = "DESCRIPTION_NOT_DEFINED"

@Deprecated("Flag without an expiry date")
const val EXPIRY_DATE_NOT_DEFINED = "EXPIRY_DATE_NOT_DEFINED"
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
class FlagType {
annotation class Experiment(
val owner: String,
val description: String,
val expiryDate: String,
)
}
Expand All @@ -53,9 +52,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
@Deprecated("Flag with no assigned owner")
const val OWNER_NOT_DEFINED = "OWNER_NOT_DEFINED"
@Deprecated("Flag without a description")
const val DESCRIPTION_NOT_DEFINED = "DESCRIPTION_NOT_DEFINED"
@Deprecated("Flag without an expiry date")
const val EXPIRY_DATE_NOT_DEFINED = "EXPIRY_DATE_NOT_DEFINED"
}
Expand All @@ -82,7 +78,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
)
@FlagType.Experiment(
owner = "Hoge Fuga",
description = "hogehoge",
expiryDate = "2023-06-01"
)
fun awesomeExperimentFeatureEnabled(): Boolean
Expand Down Expand Up @@ -127,7 +122,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
)
@FlagType.Experiment(
owner = "Hoge Fuga",
description = "hogehoge",
expiryDate = "2023-06-01",
)
fun awesomeExperimentFeatureEnabled(): Boolean
Expand Down Expand Up @@ -172,7 +166,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
)
@FlagType.Experiment(
owner = "Hoge Fuga",
description = "hogehoge",
expiryDate = "2023-06-01",
)
fun awesomeExperimentFeatureEnabled(): Boolean
Expand Down Expand Up @@ -200,12 +193,10 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
class FlagType {
annotation class Ops(
val owner: String,
val description: String,
val expiryDate: String = "",
)
annotation class Permission(
val owner: String,
val description: String,
val expiryDate: String = "",
)
}
Expand All @@ -224,7 +215,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
)
@FlagType.Ops(
owner = "Hoge Fuga",
description = "hogehoge"
)
fun awesomeOpsFeatureEnabled(): Boolean
@BooleanFlag(
Expand All @@ -233,7 +223,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
)
@FlagType.Permission(
owner = "Hoge Fuga",
description = "hogehoge"
)
fun awesomePermissionFeatureEnabled(): Boolean
}
Expand Down Expand Up @@ -274,7 +263,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
)
@FlagType.Experiment(
owner = "Hoge Fuga",
description = "hogehoge",
expiryDate = "2023-06-01",
)
fun awesomeVariationFeatureEnabled(): Boolean
Expand Down Expand Up @@ -313,7 +301,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
import tv.abema.flagfit.FlagType
import tv.abema.flagfit.annotation.BooleanFlag
import tv.abema.flagfit.FlagfitDeprecatedParams.OWNER_NOT_DEFINED
import tv.abema.flagfit.FlagfitDeprecatedParams.DESCRIPTION_NOT_DEFINED
import tv.abema.flagfit.FlagfitDeprecatedParams.EXPIRY_DATE_NOT_DEFINED
interface Example {
Expand All @@ -323,7 +310,6 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
)
@FlagType.Experiment(
owner = OWNER_NOT_DEFINED,
description = DESCRIPTION_NOT_DEFINED,
expiryDate = EXPIRY_DATE_NOT_DEFINED,
)
fun awesomeOpsFeatureEnabled(): Boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package tv.abema.fragfit

import tv.abema.flagfit.FlagType
import tv.abema.flagfit.FlagfitDeprecatedParams.DESCRIPTION_NOT_DEFINED
import tv.abema.flagfit.FlagfitDeprecatedParams.EXPIRY_DATE_NOT_DEFINED
import tv.abema.flagfit.FlagfitDeprecatedParams.OWNER_NOT_DEFINED
import tv.abema.flagfit.JustFlagSource
Expand All @@ -17,7 +16,6 @@ interface SampleFlagService {
)
@FlagType.WorkInProgress(
owner = "Hoge Fuga",
description = "hogehoge",
expiryDate = "2022-12-30"
)
fun awesomeWipFeatureEnabled(): Boolean
Expand All @@ -28,7 +26,6 @@ interface SampleFlagService {
)
@FlagType.Experiment(
owner = "Hoge Fuga",
description = "hogehoge",
expiryDate = "2322-12-30"
)
fun awesomeExperimentFeatureEnabled(): Boolean
Expand All @@ -39,7 +36,6 @@ interface SampleFlagService {
)
@FlagType.Ops(
owner = "Hoge Fuga",
description = "hogehoge"
)
fun awesomeOpsFeatureEnabled(): Boolean

Expand All @@ -49,7 +45,6 @@ interface SampleFlagService {
)
@FlagType.Permission(
owner = "Hoge Fuga",
description = "hogehoge",
expiryDate = "2022-12-30"
)
fun awesomePermissionFeatureEnabled(): Boolean
Expand All @@ -60,7 +55,6 @@ interface SampleFlagService {
)
@FlagType.WorkInProgress(
owner = OWNER_NOT_DEFINED,
description = DESCRIPTION_NOT_DEFINED,
expiryDate = EXPIRY_DATE_NOT_DEFINED
)
fun awesomeUnknownFeatureEnabled(): Boolean
Expand Down

0 comments on commit 2927ee8

Please sign in to comment.