Skip to content

Put legacy union audit table behind a deprecated feature flag #6892

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

Merged
merged 2 commits into from
Aug 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions audit/src/org/labkey/audit/AuditModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.labkey.api.audit.provider.SiteSettingsAuditProvider;
import org.labkey.api.module.DefaultModule;
import org.labkey.api.module.ModuleContext;
import org.labkey.api.settings.OptionalFeatureFlag;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.view.WebPartFactory;
import org.labkey.audit.query.AuditQuerySchema;

Expand All @@ -30,6 +32,8 @@

public class AuditModule extends DefaultModule
{
public static final String LEGACY_UNION_AUDIT_TABLE = "legacyUnionAuditTable";

@Override
@NotNull
protected Collection<WebPartFactory> createWebPartFactories()
Expand Down Expand Up @@ -75,6 +79,14 @@ public void doStartup(ModuleContext moduleContext)
AuditLogService.get().registerAuditType(new SiteSettingsAuditProvider());

AuditController.registerAdminConsoleLinks();
OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(
LEGACY_UNION_AUDIT_TABLE,
"Restore legacy union audit table",
"Restores a legacy query that unions all the event tables together into a single query. This option will be removed in LabKey Server v26.3.",
false,
false,
OptionalFeatureService.FeatureType.Deprecated
));
}

@Override
Expand Down
11 changes: 5 additions & 6 deletions audit/src/org/labkey/audit/query/AuditQuerySchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.labkey.api.query.QueryView;
import org.labkey.api.query.UserSchema;
import org.labkey.api.security.User;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.view.ViewContext;
import org.labkey.audit.AuditSchema;
import org.springframework.validation.BindException;
Expand All @@ -37,10 +38,8 @@
import java.util.LinkedHashSet;
import java.util.Set;

/**
* User: Karl Lum
* Date: Oct 5, 2007
*/
import static org.labkey.audit.AuditModule.LEGACY_UNION_AUDIT_TABLE;

public class AuditQuerySchema extends UserSchema
{
public static final String SCHEMA_NAME = "auditLog";
Expand Down Expand Up @@ -86,12 +85,12 @@ public Set<String> getTableNames()
@Override
public TableInfo createTable(String name, ContainerFilter cf)
{
// event specific audit views are implemented as queries on the audit schema
// event-specific audit views are implemented as queries on the audit schema
AuditTypeProvider provider = AuditLogService.get().getAuditProvider(name);
if (provider != null)
return provider.createTableInfo(this, cf);

if (AUDIT_TABLE_NAME.equalsIgnoreCase(name))
if (OptionalFeatureService.get().isFeatureEnabled(LEGACY_UNION_AUDIT_TABLE) && AUDIT_TABLE_NAME.equalsIgnoreCase(name))
return new AuditLogUnionTable(this, cf);

return null;
Expand Down