Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate deprecated variable removal #7105

Open
dragonchaser opened this issue Aug 23, 2023 · 2 comments
Open

Automate deprecated variable removal #7105

dragonchaser opened this issue Aug 23, 2023 · 2 comments
Labels
Category:Enhancement Add new functionality

Comments

@dragonchaser
Copy link
Contributor

dragonchaser commented Aug 23, 2023

We have introduced a method to mark variables as deprecated and removal in our code like:

// Reva defines all available REVA client configuration.
type Reva struct {
	Address string        `yaml:"address" env:"OCIS_REVA_GATEWAY;REVA_GATEWAY" desc:"The CS3 gateway endpoint." deprecationVersion:"3.0" removalVersion:"4.0.0" deprecationInfo:"REVA_GATEWAY changing name for consistency" deprecationReplacement:"OCIS_REVA_GATEWAY"`
	TLS     GRPCClientTLS `yaml:"tls"`
}

this came in handy when removing the variables for 4.0.0 (see #7099). I just realized that removing all the variables from the seperate config.go files is an effort that could be automated.

I suggest we write a small tool that will patch this code automatically

Workflow:

$> ./deprecation_helper <version>

This will remove all the variables and deprecation annotations from the code in the config.go files and will just leave us with the actual occurrences in the code, thus reducing the workload that is actually needed to remove those variables (pressing delete hundreds of time is just a waste of precious time). It would also be helpful to add an additional helper function to that tool that would point to locations where those variables are used directly through os.GetEnv() or occur in static strings etc.

Addiotional (needed) functionality:

  • Whenever a variable is removed, it needs to be written to a (text-)database
  • Upon startup ocis checks for the contents of the database, and checks if the variables are set
  • if one of the variables is still set, ocis will refuse to start up
  • deprecated variables should also be added to this database and create a log output if set upon startup
  • if there are deprecated or removed variables still set, admin (ui admin, not sysadmin) should see a toast in the ui hinting the person to contact the sysadmin to check the config
  • Note: These database(s) need to bee added to the git-repo and need to be bundled upon build!

/cc @kobergj @mmattel

@dragonchaser dragonchaser changed the title Automate deprecated variable removal [Proposal] Automate deprecated variable removal Aug 23, 2023
@mmattel
Copy link
Contributor

mmattel commented Oct 5, 2023

This is an important functionality we should asap build to relax tasks when a new major release is coming. Please prioritize.

@mmattel mmattel changed the title [Proposal] Automate deprecated variable removal Automate deprecated variable removal Oct 5, 2023
Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status:Stale label Dec 15, 2023
@micbar micbar added the Category:Enhancement Add new functionality label Dec 15, 2023
@stale stale bot removed the Status:Stale label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Enhancement Add new functionality
Projects
Status: Qualification
Development

No branches or pull requests

3 participants